# How to have the aggregate query in multi match query

**URL:** <https://discuss.elastic.co/t/how-to-have-the-aggregate-query-in-multi-match-query/243810>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-graph\
**Created:** [August 5, 2020, 6:29am UTC](https://discuss.elastic.co/t/how-to-have-the-aggregate-query-in-multi-match-query/243810 "2020-08-05T06:29:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mruthyu](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mruthyu](https://discuss.elastic.co/u/mruthyu)\
**Post date:** [August 5, 2020, 6:29am UTC](https://discuss.elastic.co/t/how-to-have-the-aggregate-query-in-multi-match-query/243810/1 "2020-08-05T06:29:03Z")

</div>

How to have the aggregate query in a multi match query ?  
I would like to have few facets returned as part of the search.

I am looking for the aggregate functionality in multi\_match query which supports search in many fields. (All searchable fields)

GET /\_search

{

"query": {

"multi\_match" : {

"query": "Will Smith",

"type": "best\_fields",

"fields": ["first\_name", "last\_name"],

"operator": "and"

}

}

}

---

<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 2, 2020, 6:29am UTC](https://discuss.elastic.co/t/how-to-have-the-aggregate-query-in-multi-match-query/243810/2 "2020-09-02T06:29:04Z")

</div>

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