Indexing in Remote ElasticSearch cluster connection using Python Client using http

I am trying to index data to a node in a remote cluster using the ElasticSearch python client. I have the details of the cluster. I have tried the following:

client= Elasticsearch(
  ['http://user:secretkey@clustername:port']

)
if not client.ping():
print("No connection")
else:
print(client.ping())

client.index(index='index_name',doc_type="doctype_name",body=JSONBody)

I get True when I ping the cluster, so I assume I am able to connect to the cluster. But when I try to index some data or perform any operation like searching the index with a query or finding cluster health, I just ok as response and the data is not indexed. How can I actually get the results/response from the index instead of just "ok"?

Have you tried to increase the logging? See https://elasticsearch-py.readthedocs.io/en/master/index.html#logging

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