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

Single value numeric queries shouldn't be handled by NumericRangeQuery #10648

Closed
wants to merge 2 commits into from
Closed

Single value numeric queries shouldn't be handled by NumericRangeQuery #10648

wants to merge 2 commits into from

Conversation

markharwood
Copy link
Contributor

For performance reasons this change uses a TermQuery wrapped in a ConstantScoreQuery instead of a NumericRangeQuery with start and end values the same.

Closes #10646

@rjernst
Copy link
Member

rjernst commented Apr 17, 2015

LGTM

@markharwood
Copy link
Contributor Author

Working on a change to address termFilter too...

…y and should use a TermQuery wrapped in a ConstantScoreQuery instead.

Closes #10646
…hanged to a final impl in NumericFieldMapper based on TermFilter.
@markharwood
Copy link
Contributor Author

@rmuir Can I get a review of this now that I've added termFilter support?
Thx

@rmuir
Copy link
Contributor

rmuir commented Apr 21, 2015

This change looks great to me. Its very important for master where otherwise we'd always read all the postings for the term into a bitset in memory, which is bad if we are e.g. AND'ing with a bunch of other clauses. Even for older branches, we would sometimes do this if the term has a high docfreq (which is exactly when you do not want to do this). So it is best to explicitly make term query/filters instead. I also like the internal cleanup, +1.

@markharwood
Copy link
Contributor Author

Thanks @rmuir - which branches would you like to see have this?

@rmuir
Copy link
Contributor

rmuir commented Apr 21, 2015

I think we should do 2.0 and 1.6 personally. Its not technically a bug, so I would omit from 1.5.2 just to be on the safe side.

@markharwood
Copy link
Contributor Author

OK - I'll push to 1.x and master if there are no objections

@jpountz
Copy link
Contributor

jpountz commented Apr 21, 2015

+1 on master and 1.x

@s1monw
Copy link
Contributor

s1monw commented Apr 21, 2015

I think we should do 2.0 and 1.6 personally. Its not technically a bug, so I would omit from 1.5.2 just to be on the safe side.

+1

@s1monw s1monw removed the v1.5.2 label Apr 21, 2015
@markharwood
Copy link
Contributor Author

Pushed to 1.x in f9e044d and master in 05c3d05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v1.6.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Single value numeric queries shouldn't be handled by NumericRangeQuery
7 participants