# Query\_string, highlighting, and aggregations

**URL:** https://discuss.elastic.co/t/query-string-highlighting-and-aggregations/153418
**Category:** Elasticsearch
**Created:** [October 22, 2018, 2:22pm UTC](https://discuss.elastic.co/t/query-string-highlighting-and-aggregations/153418 "2018-10-22T14:22:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MSS](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@MSS](https://discuss.elastic.co/u/MSS)
#### Post date: [October 22, 2018, 2:22pm UTC](https://discuss.elastic.co/t/query-string-highlighting-and-aggregations/153418/1 "2018-10-22T14:22:34Z")

</div>

I'm kind of doubting this is possible. Essentially I'm trying to search over all fields and multiple indexes. I can use highlighting to show fields where there's a match for my query. The results return and index the query was found in, and also the highlighted fields. I'd like to be able to roll this up in an aggregation of by index and highlighted fields - the number of returned results. Technically I could do this post query if the number of results were small, but I'm dealing with a lot of data.

GET \_search  
{  
"query": {  
"query\_string": { "query": "Mike" }  
},  
"highlight": {  
"fields": {  
"\*": {}  
}  
}  
}

Here I'm getting back multiple indexes and various fields. Is there any way to aggregate them in ES?

Thanks

---

<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: [November 19, 2018, 2:22pm UTC](https://discuss.elastic.co/t/query-string-highlighting-and-aggregations/153418/2 "2018-11-19T14:22:34Z")

</div>

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