Django haystack不添加Solr索引。 [与...一起工作,与索尔失败] [英] Django haystack doesn't add to Solr index. [Works with whoosh, fails with Solr]

查看:111
本文介绍了Django haystack不添加Solr索引。 [与...一起工作,与索尔失败]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在开发期间,我使用whoosh作为后端,现在要切换到
solr。我安装了solr,将设置更改为
HAYSTACK_SEARCH_ENGINE和HAYSTACK_SOLR_URL。

During development I used whoosh as a backend, and now want to switch to solr. I installed solr, changed the settings, to HAYSTACK_SEARCH_ENGINE, and HAYSTACK_SOLR_URL.

现在,当我尝试更新或重建索引失败时,
无法向Solr添加文档:[原因:无]

Now when I try to update or rebuild the index it fails with Failed to add documents to Solr: [Reason: None] .

所有搜索也是错误的对所有查询返回0个结果。
如果我更改为whoosh,这工作。但是,我有一个RealTimeSearch
索引集,在模型创建过程中,我没有收到关于不能
能够写入搜索索引的警告。 (从中我假设数据正确地被写入solr索引。

All searches are also wrong with 0 results returned for all queries.. This work if I change to whoosh. However, I have a RealTimeSearch index set, and during model creation I am getting no warning about not being able to write to search index. (From which I am assuming that data is being correctly being written to solr index.

我可以看到solr正在运行,直接转到solr开始的端口。 / p>

I can see that solr is running by going directly to the port where solr started.

推荐答案

当您的schema.xml文件配置不正确时,通常会发生此错误。

This error usually happens when your schema.xml file is improperly configured.

您可以使用 python manage.py build_solr_schema> schema.xml 生成模式。

为了真正让solr使用它,你通常将它放在 example / solr / conf / schema.xml

In order to actually have solr use it, you typically place it in example/solr/conf/schema.xml

最后:查看您的Solr服务器的日志输出,在开发过程中,我通过 java -jar start.jar 运行它,并将其隐式打印到我的屏幕上,否则你的日志去进入 example / logs 目录。

Finally: watch the log output of your Solr server. During development I have it running via java -jar start.jar and it implicitly prints to my screen. Otherwise, your logs go into the example/logs directory.

另外, HAYSTACK_SOLR_URL 。它不应该有斜杠。

Additionally, double check the HAYSTACK_SOLR_URL. It should not have a trailing slash.

这篇关于Django haystack不添加Solr索引。 [与...一起工作,与索尔失败]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆