bonsai-elasticsearch,Python,Django,Heroku,Django Haystack,bonsai Elasticsearch" /> bonsai-elasticsearch,Python,Django,Heroku,Django Haystack,bonsai Elasticsearch" />

Python 与Heroku和Django一起使用盆景Elasticsearch的IndexMissingException

Python 与Heroku和Django一起使用盆景Elasticsearch的IndexMissingException,python,django,heroku,django-haystack,bonsai-elasticsearch,Python,Django,Heroku,Django Haystack,bonsai Elasticsearch,环境:我正在使用Python 2.7.2运行Django==1.5.4,并部署到Heroku。我正在使用带有弹性搜索的Haystack。在Heroku上,我正在使用盆景弹性搜索插件 问题:运行rebuild_index命令时,在销毁索引时遇到“读取超时错误”,在尝试创建索引时遇到“IndexMissingException”。日志输出如下所示: > heroku run python manage.py rebuild_index Running `python manage.py reb

环境:我正在使用Python 2.7.2运行Django==1.5.4,并部署到Heroku。我正在使用带有弹性搜索的Haystack。在Heroku上,我正在使用盆景弹性搜索插件

问题:运行rebuild_index命令时,在销毁索引时遇到“读取超时错误”,在尝试创建索引时遇到“IndexMissingException”。日志输出如下所示:

> heroku run python manage.py rebuild_index
Running `python manage.py rebuild_index` attached to terminal... up, run.1762

WARNING: This will irreparably remove EVERYTHING from your search index in connection 'default'.
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.
Failed to clear Elasticsearch index: Non-OK response returned (404): u'IndexMissingException[[msdc] missing]'
All documents removed.
Indexing 195 schools
ERROR:root:Error updating schools using default 
Traceback (most recent call last):
  File "/app/.heroku/python/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 221, in handle_label
    self.update_backend(label, using)
  File "/app/.heroku/python/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 267, in update_backend
    do_update(backend, index, qs, start, end, total, self.verbosity)
  File "/app/.heroku/python/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 89, in do_update
    backend.update(index, current_qs)
  File "/app/.heroku/python/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend.py", line 183, in update
    self.conn.bulk_index(self.index_name, 'modelresult', prepped_docs, id_field=ID)
  File "/app/.heroku/python/lib/python2.7/site-packages/pyelasticsearch/client.py", line 96, in decorate
    return func(*args, query_params=query_params, **kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/pyelasticsearch/client.py", line 387, in bulk_index
    query_params=query_params)
  File "/app/.heroku/python/lib/python2.7/site-packages/pyelasticsearch/client.py", line 254, in send_request
    self._raise_exception(resp, prepped_response)
  File "/app/.heroku/python/lib/python2.7/site-packages/pyelasticsearch/client.py", line 268, in _raise_exception
    raise error_class(response.status_code, error_message)
ElasticHttpNotFoundError: (404, u'IndexMissingException[[msdc] missing]')
ElasticHttpNotFoundError: (404, u'IndexMissingException[[msdc] missing]')
验证:我已经明确创建了索引,我通过尝试重新创建并运行以下测试步骤对其进行了验证:

> curl -X POST http://index@box.us-east-1.bonsai.io/msdc
{"error":"Index already exists.","status":400}%

> curl -X POST http://index@boc.us-east-1.bonsai.io/msdc/test -d '{"title":"hello, world"}'
{"ok":true,"_index":"msdc","_type":"test","_id":"9q8t4m0sTgy6JeGkueL54Q","_version":1}%   

> curl -X POST http://index@box.us-east-1.bonsai.io/msdc/_search -d '{}'                  
{"took":2,"timed_out":false,"_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"msdc","_type":"test","_id":"9q8t4m0sTgy6JeGkueL54Q","_score":1.0, "_source" : {"title":"hello, world"}}]}}% 
我对Elasticsearch和Heroku相当陌生,所以我可能错过了一个关键步骤。如果您能帮助排除此错误,我们将不胜感激