So the problem is something like this I want to get posts that whose online
field is greater than a time or the field does not exist and I only want to use these two clauses as a filtering mechanism i.e. they should not contribute any score towards the search and there are other clauses that do the actual searching.
Here is what I currently have
{
"query": {
"bool": {
"should": [
{"range" : {"online" : {"gte" : time}}},
{"bool": {"must_not": {"exists": {"field": "online"}}}}
],
}
}
}
The problem is I think these are contributing to the score. If a doc where the online field is greater than time it gets a score of 1.0 and if there is a doc where the online field is not present it gets a score of 0.0