solr 5.3.1验证是否已加载schema.xml

时间:2015-11-20 20:16:14

标签: xml solr django-haystack

我正在使用django-haystack配置solr,其中一个配置步骤是使用以下命令生成schema.xml,然后将生成的文件放在solr config direcotory中:

$ python manage.py build_solr_schema

目前我在索引文件内容时遇到了一些问题,并且有几个可能的修补程序指向schema.xml的编辑但是,solar在几个地方都有schema.xml

$ find . -name schema.xml

./solr/solrj/src/test-files/solrj/solr/configsets/configset-2/conf/schema.xml
./solr/solrj/src/test-files/solrj/solr/configsets/shared/conf/schema.xml
./solr/solrj/src/test-files/solrj/solr/collection1/conf/schema.xml
./solr/solrj/src/test-files/solrj/solr/multicore/core0/conf/schema.xml
./solr/solrj/src/test-files/solrj/solr/multicore/core1/conf/schema.xml
./solr/server/solr/configsets/sample_techproducts_configs/conf/schema.xml
./solr/server/solr/configsets/basic_configs/conf/schema.xml
./solr/example/example-DIH/solr/solr/conf/schema.xml
./solr/example/example-DIH/solr/rss/conf/schema.xml
./solr/example/example-DIH/solr/mail/conf/schema.xml
./solr/example/example-DIH/solr/tika/conf/schema.xml
./solr/example/example-DIH/solr/db/conf/schema.xml
./solr/contrib/morphlines-core/src/test-files/solr/collection1/conf/schema.xml
./solr/contrib/morphlines-core/src/test-files/solr/minimr/conf/schema.xml
./solr/contrib/morphlines-core/src/test-files/solr/mrunit/conf/schema.xml
./solr/contrib/morphlines-core/src/test-files/solr/solrcelltest/collection1/conf/schema.xml
./solr/contrib/extraction/src/test-files/extraction/solr/collection1/conf/schema.xml
./solr/contrib/uima/src/test-files/uima/solr/collection1/conf/schema.xml
./solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml
./solr/contrib/velocity/src/test-files/velocity/solr/collection1/conf/schema.xml
./solr/contrib/langid/src/test-files/langid/solr/collection1/conf/schema.xml
./solr/core/src/test-files/solr/configsets/bad-mergepolicy/conf/schema.xml
./solr/core/src/test-files/solr/configsets/minimal/conf/schema.xml
./solr/core/src/test-files/solr/configsets/configset-2/conf/schema.xml
./solr/core/src/test-files/solr/collection1/conf/schema.xml

我尝试更改其中的几个文件,但我没有得到任何反馈。我删除了所有文件,solr在默认配置中工作,好像什么也没发生。

我尝试使用以下网址来提取并验证架构 - http://localhost:8983/solr/schema,但这也无效。

我正在查看solr/node1/logssolr/node2/logs中的日志文件,但它们似乎没有显示任何错误或与schema.xml相关的任何信息

文档非常混乱,因为solr行为在发行版之间的主要方式发生了变化,这使得文档相当矛盾。

Solr 5.3.1是否有一种经过验证的,可重复的方法来检查加载的schema.xml配置,或者是否有可能将所述模式转储到要检查的文件中?

2 个答案:

答案 0 :(得分:1)

这个问题与我提出的问题非常相似 - Does solr has API to read solr schema.xml?

这个答案让我找到了解决方案 - https://stackoverflow.com/a/18874263/86294

这是描述架构api - https://cwiki.apache.org/confluence/display/solr/Schema+API

的文档

需要在Solr 5.3.1中构建的url是 - http://localhost:8983/solr/gettingstarted/schema

它将浏览器中的schema.xml作为纯文本返回,并且可以使用。

<强>更新

我还发现以下说明非常有用 - https://github.com/nazariyg/Solr-5-for-django-haystack

django_haystack项目中的相关问题:#1182#1183

答案 1 :(得分:1)

我在this blog article中描述了各种Solr 5.3.1示例及其家园。

Corer目录的位置列在Solr Admin UI的overview page for the core中。

相关问题