我正在尝试遵循干草堆教程。当我运行manage.py重建索引时遇到错误
我收到以下错误:
WARNING: This will irreparably remove EVERYTHING from your search index.
Your choices after this are to restore from backups or rebuild via the `rebuild_index` command.
Are you sure you wish to continue? [y/N] y
Removing all documents from your index because you said so.
All documents removed.
/Users/heri0n/python_env/lib/python2.7/site-packages/django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (2013-04-07 16:14:15.481145) while time zone support is active.
RuntimeWarning)
Indexing 1 notes.
Failed to add documents to Solr: [Reason: None]
<response><lst name="responseHeader"><int name="status">400</int><int name="QTime">6</int></lst><lst name="error"><str name="msg">ERROR: [doc=haystacktester.note.3] unknown field 'django_id'</str><int name="code">400</int></lst></response>
我确实运行了manage.py build_solr_schema > ~/solr-4.2.1/example/solr/conf/schema.xml
我必须手动创建 conf 目录,因为它不存在。我注意到教程使用 Solr 3,而我使用 Solr 4。conf 目录的位置是否可能发生变化?
问题是Solr(haystack文档使用v3.5.0,这里你可能使用的是最新的)找不到配置文件。这 3 个步骤对我有用
将模式放置在 solr-x.y.z/example/solr/collection1/conf/schema.xml 中
在架构中将 stopwords_en.txt 更改为 lang/stopwords_en.txt
-
将版本字段(如下所述)添加到字段部分的架构中
<field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>
欲了解更多信息,请查看相同的讨论GitHub
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)