New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shard query cache not populated when there is a range filter #9225
Comments
The query cache has a mechanism that disables it automatically when SearchContext.nowInMillis() is used. One issue with that is that the date math parser always evaluates the current timestamp when parsing a date, even if it is not needed. As a consequence, whenever you use a date expression in your queries, the query cache would not be used. Close elastic#9225
The query cache has a mechanism that disables it automatically when SearchContext.nowInMillis() is used. One issue with that is that the date math parser always evaluates the current timestamp when parsing a date, even if it is not needed. As a consequence, whenever you use a date expression in your queries, the query cache would not be used. Close #9225
The query cache has a mechanism that disables it automatically when SearchContext.nowInMillis() is used. One issue with that is that the date math parser always evaluates the current timestamp when parsing a date, even if it is not needed. As a consequence, whenever you use a date expression in your queries, the query cache would not be used. Close #9225
I reported this Dec. 19 https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/elasticsearch/N39iejK6c5o/qj1AUqPxweUJ with a gist but got no feedback whatsoever. |
@ppf2 - were you able to confirm that the Gist you posted here works with ES 1.4.3? Using 1.4.3, I've been trying to get the query cache populated with a date range filter, but have been unsuccessful so far - not sure if it's something I'm doing wrong, if the bug is still there. |
@jpountz Just tested 1.4.4 with the gist in the original filing, it looks like it is still not populating the query cache when there is a range filter. |
I am reopening this then... thanks for testing |
OK, I just found the issue. There were merge conflicts when I backported to 1.4 and I left a call to SearchContext.nowInMillis. Although it did not break functionality, it disabled the query cache since we do not cache requests when the current timestamp is used. I just pushed a fix and will update the labels. For the record, things were and are still fine on master and 1.x. |
It did not work on 1.4 because of a merging issue. This is fixed now and will be available in 1.4.5. Sorry for the annoyance. |
The query cache has a mechanism that disables it automatically when SearchContext.nowInMillis() is used. One issue with that is that the date math parser always evaluates the current timestamp when parsing a date, even if it is not needed. As a consequence, whenever you use a date expression in your queries, the query cache would not be used. Close elastic#9225
Use case below.
https://gist.github.com/ppf2/bfa38b8284e09c0740ad
Query cache is turned on and the query uses search_type=count. If the query is run with just the aggregation part, the query cache is populated. As soon as a range filter is added to the query, it stops populating the query cache. Not sure why that is ...
The text was updated successfully, but these errors were encountered: