Open DIT4FUN opened 6 years ago
Hi @DIT4FUN I came across this issue as well. The problem is resolved by requiring a newer version of the elasticsearch-py
module. Do this by adding the following line in your requirements.txt
file.
tldr; Elastic Search 6+ no longer assumes application/json
so you have to upgrade the elasticsearch-py
module you are using so it passes the correct headers to elastic search.
For reference: https://github.com/elastic/elasticsearch-py
requirements.txt
# Elasticsearch 6.x
elasticsearch>=6.0.0,<7.0.0
The discusstion of this can be found here: https://github.com/elastic/elasticsearch-py/issues/718
@rhsimplex, you can probably close this or tag it as a question for others to see.
@dsandor thanks this works perfectly!
@DIT4FUN In addition, if you're not using a requirements.txt file, running pip with requirements like this also works.
pip install 'elasticsearch>=6.0.0,<7.0.0'
I am using a VMware Centos7 system,and install all software follow the guide doc! and then i test the following code:
then i got this error!