I have the following query:
{
"query": {
"function_score": {
"boost_mode": "multiply",
"functions": [
{
"field_value_factor": {
"factor": 0.5,
"field": "albums.trending_status_monthly",
"missing": 2,
"modifier": "sqrt"
}
}
],
"query": {
// ....
}
}
},
"sort": [
"_score"
]
}
album is an array of albums with individual trending scores. When I run an explain for this query, I see that Elasticsearch uses the min of albums.trending_status_monthly
:
{
"value" : 2.345208,
"description" : "min of:",
"details" : [
{
"value" : 2.345208,
"description" : "field value function: sqrt(doc['albums.trending_status_monthly'].value?:2.0 * factor=0.5)",
"details" : [ ]
},
{
"value" : 3.4028235E38,
"description" : "maxBoost",
"details" : [ ]
}
]
}
How can I change this to use the max score? Im trying to prevent using scripts as this is going to slow down the query.