# Function score query does NOT replace boost field well - how to access child's fields?!

**URL:** <https://discuss.elastic.co/t/function-score-query-does-not-replace-boost-field-well-how-to-access-childs-fields/17479>\
**Category:** Elasticsearch\
**Created:** [May 13, 2014, 10:42am UTC](https://discuss.elastic.co/t/function-score-query-does-not-replace-boost-field-well-how-to-access-childs-fields/17479 "2014-05-13T10:42:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pawel\_Mlynarczyk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pawel_mlynarczyk/32/1568_2.png) [@Pawel\_Mlynarczyk](https://discuss.elastic.co/u/Pawel_Mlynarczyk)\
**Post date:** [May 13, 2014, 10:42am UTC](https://discuss.elastic.co/t/function-score-query-does-not-replace-boost-field-well-how-to-access-childs-fields/17479/1 "2014-05-13T10:42:59Z")

</div>

Hello

Boost field is deprecated since ES 1.0.0 so I've decided to change it to  
the function score query as suggested in the docs.

So I tried to change this:

> <https://gist.github.com/zwrss/aeaf2828f6dd35a1e888#file-boost-field>

Into this:

> <https://gist.github.com/zwrss/aeaf2828f6dd35a1e888#file-function-score>

The problem is that i can't use child's fields inside the top\_children  
query. How should I handle this?

Thanks in advance

Paweł Młynarczyk

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4d68bab8-30cf-4382-bf78-36753b9f3ca6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4d68bab8-30cf-4382-bf78-36753b9f3ca6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:29am UTC](https://discuss.elastic.co/t/function-score-query-does-not-replace-boost-field-well-how-to-access-childs-fields/17479/2 "2017-07-06T01:29:49Z")

</div>


