Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can CKAN support Solr 7.0?

I am trying to install Solr 7.0 and CKAN 2.7.2 in Ubuntu 16.04. However, I got the following errors:

From Solr admin website:

ckan: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core ckan: Can't load schema /var/solr/data/ckan/conf/schema.xml: Setting defaultSearchField in schema not supported since Solr 7

From CKAN installation when initiating Database:

Solr responded with an error (HTTP 404): [Reason: Error 404 Not Found]

So I wonder whether CKAN could support the newest version of Solr. Currently, CKAN 2.7.2 can support Solr 4.6 with Jetty8.

like image 394
Kevin Cui Avatar asked Jan 23 '26 09:01

Kevin Cui


2 Answers

After some tinkering, and using this page about Solr 6.5 with CKAN as a starting point, I managed to use CKAN 2.8 with Solr 7.4 in Ubuntu 18.04:

1) in the CKAN .ini configuration file, solr_url must include the core name, otherwise CKAN calls to Solr fail (SearchError: SOLR returned an error running query ... [Reason: Error 404 Not Found] ...)

e.g. solr_url = http://127.0.0.1:8983/solr/ckan/ where ckan is the Solr core name

2) in the xml Solr schema, replace

<defaultSearchField>text</defaultSearchField>
<solrQueryParser defaultOperator="AND"/>

with

<df>text</df>
<solrQueryParser q.op="AND"/>

as those features have been deprecated (1, 2)

like image 118
lfurini Avatar answered Jan 26 '26 18:01

lfurini


Please note that since Solr 6.0 the schema.xml is not required in solr instance.

The default schema.xml is changed to managed-schema, you can use schema.xml to override this file, and then delete the managed-schema.

From your error message, you maybe should update the schema.xml as some Fields are not supported in Solr 7.0.

like image 40
Chao Jiang Avatar answered Jan 26 '26 18:01

Chao Jiang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!