问题
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.
回答1:
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)
回答2:
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.
来源:https://stackoverflow.com/questions/48533541/can-ckan-support-solr-7-0