-
"query": {
"range": { createTime: { "gte": "1483142400000" } }
} -
"filtered": {
"query": {
"match_all": {}
},
"filter":
{ "range": { "createTime": { "gte": "1483142400000" }}}
}
} -
Can you please let me know what is the difference between two queries?
-
If the output of both queries are same can you please let me know which query executes faster?
-
Is there a better way to write this query?
As you seem using an old version, the second might be faster.
In 6.x, you will have to use a bool query with a filter clause.
It does not participate to scoring and can be cached then.
We are planning to use this query for re-indexing purpose (used in the source indices to filter data). So, caching will not help. Do you still think the second query is better?
Yes. I still think it.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.