1

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. How can I actually get the results/response from the index instead of just "ok"?

0 Answers0