# Unable to retrieve field value from Doc Values in nested function\_score query

**URL:** <https://discuss.elastic.co/t/unable-to-retrieve-field-value-from-doc-values-in-nested-function-score-query/80052>\
**Category:** Elasticsearch\
**Created:** [March 26, 2017, 7:57pm UTC](https://discuss.elastic.co/t/unable-to-retrieve-field-value-from-doc-values-in-nested-function-score-query/80052 "2017-03-26T19:57:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [March 27, 2017, 8:15am UTC](https://discuss.elastic.co/t/unable-to-retrieve-field-value-from-doc-values-in-nested-function-score-query/80052/2 "2017-03-27T08:15:04Z")

</div>

hi,

> [@Junjun\_Zhang](#):
>
> One thing maybe special here is that the function\_score query is under a 'nested' query, in such case, are we not able to retrieve the field value? No documentation seems indicating so.

I would say that the function\_score is only applied on the nested documents, so the reward\_factor is not accessible

see if it can helps:

> [@Nested value on function score](https://discuss.elastic.co/t/nested-value-on-function-score/29935/8):
>
> Hello, I have a related question that I couldn't get from the previous discussion. I want to boost by a nested object field but a filtered one. Let's say I have this documents: POST /test/doc/1 { "title": "doc 1", "queries": [{ "hash": "102a", "value": 0.9 }, { "hash": "101a", "value": 0.9 }] } POST /test/doc/2 { "title": "doc 2", "queries": [ { "hash": "102a", "value": 1.0 }, {…

> [@Is it possible getting parent doc's score in nested query?](https://discuss.elastic.co/t/is-it-possible-getting-parent-docs-score-in-nested-query/69727/11):
>
> Queries wrapped by the nested query can't access the score of the parent document, because at the time of scoring the parent document hasn't been matched yet and therefor its score hasn't been computed yet.

bye,  
Xavier

---

_[View the full topic](https://discuss.elastic.co/t/unable-to-retrieve-field-value-from-doc-values-in-nested-function-score-query/80052)._
