AttributeError: 'ElasticSearch' object has no attribute 'bulk_index'"

孤人 提交于 2019-12-04 05:13:10

问题


When I try python manage.py rebuild_index, error occur:

self.conn.bulk_index(self.index_name, 'modelresult', prepped_docs, id_field=ID)   
AttributeError: 'ElasticSearch' object has no attribute 'bulk_index'

I found the link https://github.com/toastdriven/pyelasticsearch/blob/master/pyelasticsearch.py#L424-469 with pyelasticsearch.py, and I dont know which edition it is. Anyway there is bulk_index in that code, buy my pyelasticsearch.py is not. Anyone has the same experience? thanks for ur time.

Plus: django-haystack 2.0.0.beta, pyelasticsearch 0.0.6


回答1:


Django-haystack will NOT work with original pyelasticsearch. You need to use toastdrivens' fork instead: https://github.com/toastdriven/pyelasticsearch If you use pip, just type:

pip uninstall pyelasticsearch
pip install git+git://github.com/toastdriven/pyelasticsearch.git


来源:https://stackoverflow.com/questions/11963513/attributeerror-elasticsearch-object-has-no-attribute-bulk-index

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!