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

markharwood opened this Issue Apr 17, 2015 · 0 comments


None yet
2 participants
Copy link

markharwood commented Apr 17, 2015

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 self-assigned this Apr 17, 2015

markharwood added a commit that referenced this issue Apr 22, 2015

Query enhancement: Single value numeric queries shouldn’t be handled …
…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

@kevinkluge kevinkluge removed the in progress label Apr 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.