Skip to content
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

Closed
ppf2 opened this issue Jan 9, 2015 · 6 comments
Closed

Shard query cache not populated when there is a range filter #9225

ppf2 opened this issue Jan 9, 2015 · 6 comments
Assignees
Labels

Comments

@ppf2
Copy link
Member

ppf2 commented Jan 9, 2015

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 ...

@jpountz jpountz self-assigned this Jan 12, 2015
jpountz added a commit to jpountz/elasticsearch that referenced this issue Jan 13, 2015
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
jpountz added a commit that referenced this issue Jan 13, 2015
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
jpountz added a commit that referenced this issue Jan 13, 2015
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
@nezda
Copy link

nezda commented Feb 17, 2015

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.

@jpeddle
Copy link

jpeddle commented Feb 18, 2015

@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.

@ppf2
Copy link
Member Author

ppf2 commented Feb 26, 2015

@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.

@javanna
Copy link
Member

javanna commented Feb 26, 2015

I am reopening this then... thanks for testing

@javanna javanna reopened this Feb 26, 2015
@jpountz
Copy link
Contributor

jpountz commented Feb 26, 2015

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.

@jpountz
Copy link
Contributor

jpountz commented Mar 16, 2015

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.

@jpountz jpountz closed this as completed Mar 16, 2015
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants