# Using inner nested object in field value factor query

**URL:** <https://discuss.elastic.co/t/using-inner-nested-object-in-field-value-factor-query/77101>\
**Category:** Elasticsearch\
**Created:** [March 2, 2017, 7:07am UTC](https://discuss.elastic.co/t/using-inner-nested-object-in-field-value-factor-query/77101 "2017-03-02T07:07:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishva\_deepak\_tewari](https://avatars.discourse-cdn.com/v4/letter/v/f07891/32.png) [@vishva\_deepak\_tewari](https://discuss.elastic.co/u/vishva_deepak_tewari)\
**Post date:** [March 2, 2017, 7:07am UTC](https://discuss.elastic.co/t/using-inner-nested-object-in-field-value-factor-query/77101/1 "2017-03-02T07:07:52Z")

</div>

I have a scenario where I want to order the results depending on their popularity. The popularity is present as part of nested object.

To explain the problem, let's say i have a user data and as part of user data, i have information about user's fav skills. We collect the score of user's skill as part of separate process. I want to use the score of these skills as popularity factor in my scoring. I also need to ensure that new users are given priority above old users

my current query is as follows

_{_  
_"query": {_  
_"function\_score": {_  
_"query": {_  
_"bool": {_  
_"must": [_  
_{_  
_"multi\_match": {_  
_"query": "hibernate",_  
_"fields": [_  
_"user\_about^1.0",_  
_"user\_interests^1.0"_  
_],_  
_"type": "best\_fields"_  
_}_  
_}_  
_]_  
_}_  
_},_  
_"functions": [_  
_{_  
_"filter": {_  
_"match\_all": {_  
_"boost": 1_  
_}_  
_},_  
_"exp": {_  
_"creationDate": {_  
_"origin": "2017-03-02T01:19:48.641Z",_  
_"scale": "5d",_  
_"decay": 0.5_  
_},_  
_"multi\_value\_mode": "MIN"_  
_}_  
_},_  
_{_  
_"filter": {_  
_"nested": {_  
_"query": {_  
_"match": {_  
_"skills.skill\_name": {_  
_"query": "hibernate"_  
_}_  
_}_  
_},_  
_"path": "skills"_  
_"score\_mode": "avg",_  
_"boost": 1_  
_}_  
_},_  
_"field\_value\_factor": {_  
_"field": "skills.skill\_score",_  
_"factor": 1,_  
_"modifier": "ln1p"_  
_}_  
_}_  
_]_  
_}_  
_},_  
_"sort": [_  
_{_  
\_"_score": {_  
_"order": "desc"_  
_}_  
_}_  
_]_  
_}_

When i run this query, i get an error mentioning  
Missing value for field [skills.skill\_score].

How should i modify my query to accomplish my task.

Thanks

---

<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:** [March 30, 2017, 7:07am UTC](https://discuss.elastic.co/t/using-inner-nested-object-in-field-value-factor-query/77101/2 "2017-03-30T07:07:57Z")

</div>

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