# Multi\_match query on different fields. How to find which field matched?

**URL:** <https://discuss.elastic.co/t/multi-match-query-on-different-fields-how-to-find-which-field-matched/11509>\
**Category:** Elasticsearch\
**Created:** [April 9, 2013, 3:19pm UTC](https://discuss.elastic.co/t/multi-match-query-on-different-fields-how-to-find-which-field-matched/11509 "2013-04-09T15:19:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yogesh](https://avatars.discourse-cdn.com/v4/letter/y/49beb7/32.png) [@yogesh](https://discuss.elastic.co/u/yogesh)\
**Post date:** [April 9, 2013, 3:19pm UTC](https://discuss.elastic.co/t/multi-match-query-on-different-fields-how-to-find-which-field-matched/11509/1 "2013-04-09T15:19:53Z")

</div>

Hi,

I have a multi\_match query on different fields and is working fine.  
Included sample query used..

"multi\_match": {  
"query": "name for channel",  
"type": "phrase",  
"fields": [  
"title",  
"description",  
"channel"  
]  
}

- This query is working fine for me.

Question - In the result set, is it possible to find out which field(s)  
matched the query?

Any pointers are greatly appreciated.

regards,  
Yogesh

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 10, 2013, 4:14pm UTC](https://discuss.elastic.co/t/multi-match-query-on-different-fields-how-to-find-which-field-matched/11509/2 "2013-04-10T16:14:09Z")

</div>

Take a look at Highlighting API[http://www.elasticsearch.org/guide/reference/api/search/highlighting/](http://www.elasticsearch.org/guide/reference/api/search/highlighting/). This  
is not exactly what you are looking for, but it might work for you.

On Tuesday, April 9, 2013 11:19:53 AM UTC-4, [yog...@vubeology.com](mailto:yog...@vubeology.com) wrote:

> Hi,
> 
> I have a multi\_match query on different fields and is working fine.  
> Included sample query used..
> 
> "multi\_match": {  
> "query": "name for channel",  
> "type": "phrase",  
> "fields": [  
> "title",  
> "description",  
> "channel"  
> ]  
> }
> 
> - This query is working fine for me.
> 
> Question - In the result set, is it possible to find out which field(s)  
> matched the query?
> 
> Any pointers are greatly appreciated.
> 
> regards,  
> Yogesh

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:41am UTC](https://discuss.elastic.co/t/multi-match-query-on-different-fields-how-to-find-which-field-matched/11509/3 "2017-07-06T02:41:44Z")

</div>


