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 #10646

Closed
markharwood opened this issue Apr 17, 2015 · 0 comments
Closed
Assignees
Labels
:Search/Search Search-related issues that do not fall into other categories

Comments

@markharwood
Copy link
Contributor

Various clauses in the Query DSL allow criteria that matches a single numeric term and these are resolved behind the scenes by calling NumericFieldMapper.termQuery().
Currently all subclasses of NumericFieldMapper implement this method by returning a NumericRangeQuery with the same start and end value. Instead it would be more efficient to return a TermQuery wrapped in a ConstantScoreQuery.

As well as providing a performance improvement this change will lay the foundations for #10628 which will add an option to use the TermQueries, unwrapped, to allow numeric fields to make use of the usual Lucene ranking behaviour (IDF + norms).

@markharwood markharwood added the :Search/Search Search-related issues that do not fall into other categories label Apr 17, 2015
@markharwood markharwood self-assigned this Apr 17, 2015
markharwood added a commit that referenced this issue Apr 22, 2015
…by NumericRangeQuery.

They should use a ConstantScoreQuery wrapping a TermQuery as this is more efficient.
Similarly, single value numeric filters shouldn’t use a NumericRangeFilter

Closes #10646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants