Can CKAN support Solr 7.0?

﹥>﹥吖頭↗ 提交于 2020-01-13 19:26:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!