1

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 Answer 1

3

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
Sign up to request clarification or add additional context in comments.

4 Comments

I have download pyelasticsearch with :git clone https://github.com/toastdriven/pyelasticsearch.git. I got 0.0.6. And now I select the branch(I forgot which branch I selected, maybe master or bulk_index. Any way there is bulk_index and argument prepare_body in _send_request.) I downloaded with zip package. and I found that the edition is 0.0.5, after installation with python setup.py install. And it works.
Do you mean that I should select the branches? but how do you know which branch should be selected? @jasisz
OH this (https://github.com/rhec/pyelasticsearch.git) is the one I downloaded at the first time, which is the original one.
This is no longer a concern, haystack's own documentation mentions to use pip install pyelasticsearch now. django-haystack.readthedocs.org/en/latest/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.