我正在尝试使用 elasticsearch 后端设置 haystack 搜索我收到以下错误:
./manage.py rebuild_index
...
Failed to clear Elasticsearch index: (404, u'IndexMissingException[[haystack] missing]')
但是,以下命令有效:
curl -XPUT http://33.33.33.1:9200/haystack
{"ok":true,"acknowledged":true}
curl -XGET http://33.33.33.1:9200/haystack/test/something
{"_index":"haystack","_type":"test","_id":"something","exists":false}
现在,运行后
./manage.py rebuild_index
...
Failed to clear Elasticsearch index: (404, u'IndexMissingException[[haystack] missing]')
再次,突然按预期工作的命令现在给出以下错误:
curl -XGET http://33.33.33.1:9200/haystack/test/something
{"error":"IndexMissingException[[haystack] missing]","status":404}
正如其他地方所建议的那样,我也尝试过:
from django.core import management
from haystack import connections
backend = connections['default'].get_backend()
backend.setup_complete = False
backend.existing_mapping = None
management.call_command('rebuild_index', interactive=False, verbosity=0)
结果相同:
{"error":"IndexMissingException[[haystack] missing]","status":404}
我正在运行 Django 1.4.2,来自 github 的 django-haystack HEAD 和来自 github 的 pyelasticsearch HEAD
配置:
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://33.33.33.1:9200/',
'INDEX_NAME': 'haystack',
},
}
谁能帮我?