AttributeError:“ElasticSearch”对象没有“bulk”属性“index”

2024-09-28 22:15:39 发布

您现在位置:Python中文网/ 问答频道 /正文

当我尝试python manage.py rebuild_index时,出现错误:

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

我找到了https://github.com/toastdriven/pyelasticsearch/blob/master/pyelasticsearch.py#L424-469的链接pyelasticsearch.py,我不知道是哪个版本。不管怎样,代码中有bulk_index,请购买我的pyelasticsearch.py不是。 有人有同样的经历吗?谢谢你的时间。在

加上: django haystack 2.0.0.beta,pyelasticsearch 0.0.6


Tags: namepyselfiddocsfieldindexmanage
1条回答
网友
1楼 · 发布于 2024-09-28 22:15:39

Django haystack将无法使用原始pyelasticsearch。您需要使用toastdrivens的fork来代替:https://github.com/toastdriven/pyelasticsearch 如果使用pip,只需键入:

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

相关问题 更多 >