本文介绍了AttributeError:'ElasticSearch'对象没有属性'bulk_index'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试 python manage.py rebuild_index 时,会发生错误:

  self.conn.bulk_index(self.index_name,'modelresult',prepped_docs,id_field = ID)
AttributeError:'ElasticSearch'对象没有属性'bulk_index'
/ pre>

我发现链接与pyelasticsearch.py​​,我不知道哪个版本是。无论如何,该代码中有 bulk_index ,购买我的pyelasticsearch.py​​不是。
任何人都有相同的经验?谢谢你的时间。



加:
django-haystack 2.0.0.beta,pyelasticsearch 0.0.6

解决方案

Django-haystack不会使用原始的pyelasticsearch。您需要使用toastdrivens的叉子:
如果使用pip,只需键入:

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


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

解决方案

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

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

这篇关于AttributeError:'ElasticSearch'对象没有属性'bulk_index'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 10:06