Cannot create index in elasticsearch 7.0.0 using python


I'm using python to create index in my elasticsearch.

from elasticsearch import Elasticsearch
es = Elasticsearch(es_url)
es.index(index=<INDEX_NAME>, doc_type="type", body="body", id=record_id)

But it returns:

POST /<INDEX_NAME>/type [status:406 request:0.004s]
The log None failed to send to ES (This is potentially due to a mapping conflict)

(I know mapping conflict part was because es 7.0.0 doesn't support 'doc_type' other than default '_doc')

As you can see, there's no elasticsearch url in POST it's value is 'None'. But if a make a spell mistake in the es_url variable, i get proper POST url.

I tried checking setting es_url to different es endpoint. but got same error as that es too was of 7.0.0 version.

Please help!


Never mind. The elasticsearch python module version was incompatible. I did pip install --upgrade elasticsearch and it worked.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.