While querying, I am trying to get only documents whose normalized scores(_score
divided by max_score
) are above a certain threshold. Is there any way to do that? I tried using function score, but I am getting a SearchPhaseExecutionException
.
My query using the sense plugin:
POST my_index/my_type/_search
{
"query": {
"min_score": 0.4,
"function_score" : {
"query" :{
"query_string": { "_all": "test"}
},
"functions": [
{
"script_score": {
"script": "return _score / max_score;"
}
}
]
}
}
}
Exception trace: "error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures