问题描述
当我尝试 python manage.py rebuild_index
时,会发生错误:
self.conn.bulk_index(self.index_name,'modelresult',prepped_docs,id_field = ID)
/ pre>
AttributeError:'ElasticSearch'对象没有属性'bulk_index'
我发现链接与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'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!