AttributeError:“ElasticSearch”对象没有属性“bulk_index””

2023-12-02

当我尝试时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与elasticsearch.py​​,我不知道它是哪个版本。无论如何有bulk_index在该代码中,买我的 pyelasticsearch.py​​ 不是。 有人有同样的经历吗?感谢您抽出时间。

加: django-haystack 2.0.0.beta,pyelasticsearch 0.0.6


Django-haystack 不适用于原始的 pyelasticsearch。您需要使用 toastdrivens 的 fork 来代替:https://github.com/toastdriven/pyelasticsearch如果您使用 pip,只需输入:

pip uninstall pyelasticsearch
pip install git+git://github.com/toastdriven/pyelasticsearch.git
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

AttributeError:“ElasticSearch”对象没有属性“bulk_index”” 的相关文章

随机推荐