Reputation: 377
I've a query that return a score NULL.
{
"query": {
"match_all": {}
},
"sort": {
"_script": {
"script": "doc['price'].value * doc['sales.quarter'].value",
"type": "number",
"order": "desc"
}
},
"size": 15,
"from": 0
}
I want to get 15th best sales and this query returns a _score equals to NULL
Do you know why this happen ?
Upvotes: 2
Views: 2034
Reputation: 377
I've found a solution: Custom score query !
{
"query": {
"custom_score": {
"query": {
"match_all": {}
},
"script": "doc['sales.quarter'].value * doc['price'].value"
}
},
"size": 15,
"from": 0
}
Upvotes: 2