# Find the shot field in nested field with python

**URL:** <https://discuss.elastic.co/t/find-the-shot-field-in-nested-field-with-python/139969>\
**Category:** Elasticsearch\
**Created:** [July 13, 2018, 3:05pm UTC](https://discuss.elastic.co/t/find-the-shot-field-in-nested-field-with-python/139969 "2018-07-13T15:05:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hrdxwandg](https://avatars.discourse-cdn.com/v4/letter/h/ad7895/32.png) [@hrdxwandg](https://discuss.elastic.co/u/hrdxwandg)\
**Post date:** [July 13, 2018, 3:05pm UTC](https://discuss.elastic.co/t/find-the-shot-field-in-nested-field-with-python/139969/1 "2018-07-13T15:05:05Z")

</div>

I want to find the match field in a nested field.

the nested field is comprise of two fields as follows:  
"text":{  
"song":text  
"lyrics":text  
}

when i use nested query, the score\_mode is set to type max. So i want to get the max score from field song or lyrics. And I want to get which field the max score come from.

How can I realize it with python library such as elasticsearch\_dsl. inner\_hits or others? please give an example for me.

thanks ahead

---

<div class="post-metadata">

**Author:** ![hrdxwandg](https://avatars.discourse-cdn.com/v4/letter/h/ad7895/32.png) [@hrdxwandg](https://discuss.elastic.co/u/hrdxwandg)\
**Post date:** [July 16, 2018, 6:19am UTC](https://discuss.elastic.co/t/find-the-shot-field-in-nested-field-with-python/139969/2 "2018-07-16T06:19:11Z")

</div>

anybody can help?

---

<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 13, 2018, 6:19am UTC](https://discuss.elastic.co/t/find-the-shot-field-in-nested-field-with-python/139969/3 "2018-08-13T06:19:13Z")

</div>

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