# Multiple field\_value\_factors in function\_score?

**URL:** <https://discuss.elastic.co/t/multiple-field-value-factors-in-function-score/21971>\
**Category:** Elasticsearch\
**Created:** [February 4, 2015, 11:23am UTC](https://discuss.elastic.co/t/multiple-field-value-factors-in-function-score/21971 "2015-02-04T11:23:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AS1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/as1/32/948_2.png) [@AS1](https://discuss.elastic.co/u/AS1)\
**Post date:** [February 4, 2015, 11:23am UTC](https://discuss.elastic.co/t/multiple-field-value-factors-in-function-score/21971/1 "2015-02-04T11:23:50Z")

</div>

Hello,

From the docs it's not clear if and how I can have multiple  
field\_value\_factors inside a function\_score. I would like to boost by  
ratingCount and by averageRating. I was expecting something like this:

```
"query": {
    "function_score": {
        "query" : {
            [..truncated...]
        },
        "field_value_factor": {
            "field": "ratingCount",
            "modifier": "log1p"
        },
        "field_value_factor": {
            "field": "avgRating",
            "modifier": "log1p"
        }
    }
}

```

What's the correct syntax for this, or what are (better) alternatives?

/AS

--  
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/7767780b-b84b-4e53-a0ba-326fc95ae980%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7767780b-b84b-4e53-a0ba-326fc95ae980%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![skilledDeveloper](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skilleddeveloper/32/52979_2.png) [@skilledDeveloper](https://discuss.elastic.co/u/skilledDeveloper)\
**Post date:** [September 14, 2016, 8:48pm UTC](https://discuss.elastic.co/t/multiple-field-value-factors-in-function-score/21971/2 "2016-09-14T20:48:43Z")

</div>

Any luck with this?

---

<div class="post-metadata">

**Author:** ![moy2010](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moy2010/32/22403_2.png) [@moy2010](https://discuss.elastic.co/u/moy2010)\
**Post date:** [April 2, 2017, 5:46am UTC](https://discuss.elastic.co/t/multiple-field-value-factors-in-function-score/21971/3 "2017-04-02T05:46:51Z")

</div>

Trying to do exactly the same. Did you have any luck?

---

<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 5, 2017, 10:01pm UTC](https://discuss.elastic.co/t/multiple-field-value-factors-in-function-score/21971/4 "2017-07-05T22:01:34Z")

</div>


