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

Comments

@ppf2
Copy link
Member

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 jpountz closed this in b8be8e4 Jan 13, 2015
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

This comment has been minimized.

Copy link

commented Feb 17, 2015

@jpeddle

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link
Member

commented Feb 26, 2015

I am reopening this then... thanks for testing

@jpountz

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

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 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
Projects
None yet
5 participants
You can’t perform that action at this time.