# Filtering the output columns in multi index search query

**URL:** <https://discuss.elastic.co/t/filtering-the-output-columns-in-multi-index-search-query/234947>\
**Category:** Elasticsearch\
**Created:** [May 29, 2020, 3:21pm UTC](https://discuss.elastic.co/t/filtering-the-output-columns-in-multi-index-search-query/234947 "2020-05-29T15:21:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muna](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Muna](https://discuss.elastic.co/u/Muna)\
**Post date:** [May 29, 2020, 3:21pm UTC](https://discuss.elastic.co/t/filtering-the-output-columns-in-multi-index-search-query/234947/1 "2020-05-29T15:21:29Z")

</div>

Hi,

we are trying to get the specific field of source [output columns] for specific indices for the multi index search query . applying '\_source' at route level is not working . please advise how to get this.

GET language,country/\_search  
{  
"aggs": {"language,country,": {  
"terms": {  
"field": "{\_index}"  
}  
}  
},  
"query": {  
"bool": {  
"should": [  
{  
"bool": {  
"filter": [  
{  
"terms": {  
"\_index": [  
"language"  
]  
}  
}  
]  
}  
},  
{  
"bool": {  
"filter": [  
{  
"terms": {  
"\_index": [  
"country"  
]  
}  
}  
]  
}  
}  
]  
}  
}  
}

here i want to filter in such a way that i can get only few fields from country index.

---

<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:** [June 26, 2020, 3:21pm UTC](https://discuss.elastic.co/t/filtering-the-output-columns-in-multi-index-search-query/234947/2 "2020-06-26T15:21:29Z")

</div>

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