How are solr and postgreSQL connected in ckan?

571 views Asked by At

I can't find how solr link to postgreSQL in ckan.

I wrote solr_url = http://127.0.0.1:8983/solr, and sqlalchemy.url = postgresql://ckan_default:123456@localhost/ckan_default in my development.ini file, but I'm confused how does solr know that its dataset is ckan_default.

I didn't find config file for solr,src/ckan/ckan/config/solr/schema.xmlonly have filed information. /var/lib/solr/data and /etc/solr/conf/solrconfig.xml have no dataset information either.

Thanks!

2

There are 2 answers

2
Florian Brucker On BEST ANSWER

In CKAN, Solr is not directly linked to PostgreSQL. The Solr index is maintained by the CKAN code itself, see ckan.lib.search.index. Extensions can hook into the indexing via the before_index method of the IPackageController interface.

1
Connor Gurney On

I believe that after localhost/, the database name is stated. In this case, it's ckan_default.