# How to return the field name when "best\_fields" matching mode is used?

**URL:** <https://discuss.elastic.co/t/how-to-return-the-field-name-when-best-fields-matching-mode-is-used/191495>\
**Category:** Elasticsearch\
**Created:** [July 21, 2019, 12:15am UTC](https://discuss.elastic.co/t/how-to-return-the-field-name-when-best-fields-matching-mode-is-used/191495 "2019-07-21T00:15:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![germax](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@germax](https://discuss.elastic.co/u/germax)\
**Post date:** [July 21, 2019, 12:15am UTC](https://discuss.elastic.co/t/how-to-return-the-field-name-when-best-fields-matching-mode-is-used/191495/1 "2019-07-21T00:15:43Z")

</div>

When using "best\_fields" multi-matching mode, how can I get the name of the field that produced that best scoring hit? Should I dig into "explain: true" object or there are easier ways?

I read docs, but couldn't find a solution to this rather simple question. Any help appreciated.

---

<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:** [August 18, 2019, 12:15am UTC](https://discuss.elastic.co/t/how-to-return-the-field-name-when-best-fields-matching-mode-is-used/191495/2 "2019-08-18T00:15:48Z")

</div>

Closed on August 18, 2019, 12:15am UTC

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