Skip to content

IndexSortSortedNumericDocValuesRangeQuery can fail on sparse values. #61766

@jtibshirani

Description

@jtibshirani

In #56657 we integrated a new Lucene query called IndexSortSortedNumericDocValuesRangeQuery that can speed up certain range queries. In the following scenario, this query can fail:

  • The index is sorted, and not all documents have a value for the index sort field.
  • We run a bool query containing these must clauses: a range query on the index sort field, plus another restrictive clause.

The root cause is a bug in IndexSortSortedNumericDocValuesRangeQuery where we don't always obey the DocIdSetIterator contract. In particular, even when advance returns NO_MORE_DOCS, the docID() method could return an old doc ID.

Since the bug is a violation of a lower-level Lucene contract, there may be other situations where the query fails other than the one above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search/SearchSearch-related issues that do not fall into other categories>bugTeam:SearchMeta label for search teamblocker

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions