I have the next Query:
curl -X POST "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
{
"query": {
"bool" : {
"must" :
{ "term" :
{ "message" :
{
"value": "message",
"boost": 2.0
}
}
},
"should" :
{ "term" :
{ "message" :
{
"value": "message",
"boost": 2.0
}
}
}
}
}
}
'
The _score
that I get from this response is multiple by 2 of _score
(which I get without one of the scopes (must
/ should
) )
My question is if there is a way to change the action to multiple instead of addition
for example - instead _score + _score
I'll get _score * _score
You can make use of function score query
A working example (using script score):
_score
will be multiplied by_score
Mappings
Insert documents
Search query without
script_score
Results:
Search query using
script_score
Results