Connection error with Elastic Search Python Client

Viewed 418

I was trying to learn and use the elasticsearch Python client on Windows and got stuck with a connection error.

I ran the bin\elasticsearch.bat file that comes with the .zip from the official page: https://www.elastic.co/downloads/elasticsearch

I opened a Jupyter notebook and tried to run:

from elasticsearch import Elasticsearch
es = Elasticsearch(hosts=["http://localhost:9200"])
es.indices.create(index="users")

It returned the following error:

ConnectionError: Connection error caused by: ConnectionError(Connection error caused by: ProtocolError(('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))))

Is it a problem of not having a correct JSON format when communicating? How to solve it?

0 Answers
Related