# Cross Cluster search || \_index value filtering

**URL:** <https://discuss.elastic.co/t/cross-cluster-search-index-value-filtering/217769>\
**Category:** Elasticsearch\
**Tags:** ccs-cross-cluster-search\
**Created:** [February 4, 2020, 10:48am UTC](https://discuss.elastic.co/t/cross-cluster-search-index-value-filtering/217769 "2020-02-04T10:48:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeepakBhatt](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@DeepakBhatt](https://discuss.elastic.co/u/DeepakBhatt)\
**Post date:** [February 4, 2020, 10:48am UTC](https://discuss.elastic.co/t/cross-cluster-search-index-value-filtering/217769/1 "2020-02-04T10:48:24Z")

</div>

Hi Team,

```
  While using cross cluster search we are not able to filter out the records on _index attribute. We are using ES version 6.8 FYI. Please find the below query:

```

GET index1,index2,cluster2:index3,cluster2:index4/\_search  
{  
"size": 10,  
"query": {  
"bool": {  
"should": [  
{  
"bool": {  
"must": [  
{  
"query\_string": {  
"query": "S\*",  
"fields": [  
"attribute1^1.0"  
],  
"type": "best\_fields"  
}  
},  
{  
"query\_string": {  
"query": "7\*",  
"fields": [  
"attribute2^1.0"  
],  
"type": "best\_fields"  
}  
},  
{  
"query\_string": {  
"query": "8\*",  
"fields": [  
"attribute3^1.0"  
],  
"type": "best\_fields"  
}  
},  
{  
"query\_string": {  
"query": "2\*",  
"fields": [  
"attribute4^1.0"  
],  
"type": "best\_fields",  
"default\_operator": "or"  
}  
},  
{  
"query\_string": {  
"query": "cluster2:index3 OR cluster2:index4",  
"fields": [  
"\_index^1.0"  
]  
}  
}  
]  
}  
}  
]  
}  
}  
}

if we remove \_index filtering query, the query will produce result.

We are running queries without the cluster name for same cluster and below query is working fine. For example:  
GET index1,index2,cluster2:index3/\_search  
{  
"size": 10,  
"query": {  
"bool": {  
"should": [  
{  
"bool": {  
"must": [  
{  
"query\_string": {  
"query": "index1 OR index2",  
"fields": [  
"\_index^1.0"  
]  
}  
}  
]  
}  
}  
]  
}  
}  
}

Can you please let me know why the first query is not working?

Thanks!  
Deepak Bhatt

---

<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:** [March 3, 2020, 10:52am UTC](https://discuss.elastic.co/t/cross-cluster-search-index-value-filtering/217769/2 "2020-03-03T10:52:36Z")

</div>

Closed on March 3, 2020, 10:52am UTC

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