# Indexing in Remote ElasticSearch cluster connection using Python Client using http

**URL:** <https://discuss.elastic.co/t/indexing-in-remote-elasticsearch-cluster-connection-using-python-client-using-http/211224>\
**Category:** Elasticsearch\
**Created:** [December 10, 2019, 6:09am UTC](https://discuss.elastic.co/t/indexing-in-remote-elasticsearch-cluster-connection-using-python-client-using-http/211224 "2019-12-10T06:09:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpzx11](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dpzx11](https://discuss.elastic.co/u/dpzx11)\
**Post date:** [December 10, 2019, 6:09am UTC](https://discuss.elastic.co/t/indexing-in-remote-elasticsearch-cluster-connection-using-python-client-using-http/211224/1 "2019-12-10T06:09:26Z")

</div>

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"?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 10, 2019, 12:42pm UTC](https://discuss.elastic.co/t/indexing-in-remote-elasticsearch-cluster-connection-using-python-client-using-http/211224/2 "2019-12-10T12:42:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 7, 2020, 12:42pm UTC](https://discuss.elastic.co/t/indexing-in-remote-elasticsearch-cluster-connection-using-python-client-using-http/211224/3 "2020-01-07T12:42:58Z")

</div>

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