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

Queries are never cached when date math expressions are used (including exact dates) #9269

Closed

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented 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

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
@bleskes
Copy link
Contributor

bleskes commented Jan 13, 2015

LGTM. Good catch. The only thing I would recommend is changing the title of the PR to something less generic and more descriptive of the actual problem - like 'Queries are not cached when exact date values are used`

@jpountz jpountz changed the title Query cache: Make the query cache usable on time-based data. Query cache: Queries are never cached when date math expressions are used (including exact dates) Jan 13, 2015
@jpountz
Copy link
Contributor Author

jpountz commented Jan 13, 2015

LGTM. Good catch.

All the fame should go to @ppf2

I just updated the title.

@jpountz jpountz added >bug and removed review labels Jan 13, 2015
@jpountz jpountz closed this Jan 19, 2015
@jpountz jpountz added v1.4.5 and removed v1.4.3 labels Feb 26, 2015
@jpountz
Copy link
Contributor Author

jpountz commented Feb 26, 2015

Changing labels: the bug still existed on 1.4 due to a badly resolved merge conflict. So the fix will actually be in 1.4.5.

@clintongormley clintongormley added the :Search/Search Search-related issues that do not fall into other categories label Mar 19, 2015
@clintongormley clintongormley changed the title Query cache: Queries are never cached when date math expressions are used (including exact dates) Queries are never cached when date math expressions are used (including exact dates) Jun 8, 2015
mute pushed a commit to mute/elasticsearch that referenced this pull request Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker >bug :Search/Search Search-related issues that do not fall into other categories v1.4.5 v1.5.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shard query cache not populated when there is a range filter
3 participants