I have same question with alfarid23's last question in this page
http://elasticsearch-users.115913.n3.nabble.com/Adjust-score-based-on-the-number-of-matches-in-Boolean-filter-td3747186.html#a3751560
My query is,
{
"query":{
"custom_filters_score":{
"query":{"term":{"name":"sample"}},
"filters": [
{
"filter":{
"has_child":{
"type": "rating",
"query": {
"term": {"user_id":"1"}
}
}
},
"script": "NUMBER_OF_MATCHES"
}
],
"score_mode" : "first"
}
}
}
I want to boost as much as number of matches by filter.
I tested with "doc.score" in script, but not working.
Please help. Thanks in advance.