I have many documents containing a rate
property which is an array containing min/max range of accepted rates.
{ "rate": [250, 700] }
I now would like to perform queries providing another range, for example:
{
"bool": {
"must": [
"range": {
"rate": { "from": 100, "to": 500 }
}
]
}
}
That works fine and always returns values that have at least one of the values provided inside the range which is what I want.
However, for all results, the score is the same. It doesn't matter if the value is the same as on the document or it just hits the range for a few numbers. As shown below:
{
"_id": "one",
"_score": 1",
"_source": { "rate": [250,750] }
},
{
"_id": "two",
"_score": 1",
"_source": { "rate": [200,350] }
},
{
"_id": "three",
"_score": 1",
"_source": { "rate": [500,750] }
}
Is there any way to improve a range search providing another range like this?