# Elasticsearch-py not compatible with cross cluster search

**URL:** <https://discuss.elastic.co/t/elasticsearch-py-not-compatible-with-cross-cluster-search/140713>\
**Category:** Elasticsearch\
**Created:** [July 19, 2018, 11:57am UTC](https://discuss.elastic.co/t/elasticsearch-py-not-compatible-with-cross-cluster-search/140713 "2018-07-19T11:57:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbailey](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@bbailey](https://discuss.elastic.co/u/bbailey)\
**Post date:** [July 19, 2018, 11:57am UTC](https://discuss.elastic.co/t/elasticsearch-py-not-compatible-with-cross-cluster-search/140713/1 "2018-07-19T11:57:11Z")

</div>

We have been using the elasticsearch-py module for a couple of years to automate data analysis across a multiple clusters using tribe nodes. We have now replaced the tribe nodes with cross cluster search nodes but seem unable to query the indexes using the cross cluster search syntax

Using es = Elasticsearch("cluster\_name:index\_name") or es = Elasticsearch("\*:index\_name") both fail with 404, 'index\_not\_found\_exception', 'no such index' errors

is there a plan to make elasticsearch-py compatible with CCS in the near future ?

---

<div class="post-metadata">

**Author:** ![nicklang](https://avatars.discourse-cdn.com/v4/letter/n/b5ac83/32.png) [@nicklang](https://discuss.elastic.co/u/nicklang)\
**Post date:** [July 27, 2018, 3:56pm UTC](https://discuss.elastic.co/t/elasticsearch-py-not-compatible-with-cross-cluster-search/140713/2 "2018-07-27T15:56:47Z")

</div>

@bbailey

Thanks for raising this issue. Unfortunately CCS has flown under my radar as something that needed support in elasticsearch-py.

I've created a ticket in the [Github Repo](https://github.com/elastic/elasticsearch-py/issues/829) for this and will be working on it asap.

---

<div class="post-metadata">

**Author:** ![nicklang](https://avatars.discourse-cdn.com/v4/letter/n/b5ac83/32.png) [@nicklang](https://discuss.elastic.co/u/nicklang)\
**Post date:** [August 10, 2018, 9:43pm UTC](https://discuss.elastic.co/t/elasticsearch-py-not-compatible-with-cross-cluster-search/140713/3 "2018-08-10T21:43:57Z")

</div>

@bbailey

Sorry for the lateness of this.

But I just checked for Cross Cluster support and it appears to be working just fine.

The issue, after I re-read your question is the way you are instantiating the object.

first off you should create the `Elasticsearch` object with a host name not a `cluster:index`combo.

ie: `es = Elasticsearch("cluster_name:index_name")` is wrong

you want to do this:

`es = Elasticsearch("hostname")`

Then to do cross cluster search you would invoke a search like this:

`es.search(index="cluster_name:index_name", body={"query": {"match_all": {}}})`

**THIS** is assuming you've configured your two clusters properly to have cross cluster search setup.

---

<div class="post-metadata">

**Author:** ![bbailey](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@bbailey](https://discuss.elastic.co/u/bbailey)\
**Post date:** [August 21, 2018, 10:30am UTC](https://discuss.elastic.co/t/elasticsearch-py-not-compatible-with-cross-cluster-search/140713/4 "2018-08-21T10:30:36Z")

</div>

Thanks Nick, I can confirm that it is working for me also now with the changes you suggested and can search across all clusters using a wildcard for cluster\_name. I also tried elasticsearch\_dsl and that worked fine also.

---

<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:** [September 18, 2018, 10:30am UTC](https://discuss.elastic.co/t/elasticsearch-py-not-compatible-with-cross-cluster-search/140713/5 "2018-09-18T10:30:40Z")

</div>

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