I am trying to setup haystack search with elasticsearch backend I am receiving the following error:
./manage.py rebuild_index
...
Failed to clear Elasticsearch index: (404, u'IndexMissingException[[haystack] missing]')
However, the following command works:
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}
Now, after running
./manage.py rebuild_index
...
Failed to clear Elasticsearch index: (404, u'IndexMissingException[[haystack] missing]')
again, suddenly the command that worked as expected now gives the following error:
curl -XGET http://33.33.33.1:9200/haystack/test/something
{"error":"IndexMissingException[[haystack] missing]","status":404}
As suggested in other places I also tried:
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)
with the same result:
{"error":"IndexMissingException[[haystack] missing]","status":404}
I am running Django 1.4.2, django-haystack HEAD from github and pyelasticsearch HEAD from github
config:
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://33.33.33.1:9200/',
'INDEX_NAME': 'haystack',
},
}
Can anyone help me?