Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-9584

PointInSetQuery does not terminate early if result iterator has no docs

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 7.7.3, 8.6.3
    • None
    • core/search
    • New

    Description

      Today, in a point in set query after BKD intersect we get a DocIdSetBuilder result, if result's iterator have no docs, then the PointInSetQuery still create ConstantScoreScorer with an empty DocIdSetIterator. 

      In a Boolean Query, such as query = subQuery1 AND subQuery2 AND subQuery3 .... subQueryN

      if subQuery1 is a PointInSetQuery and get an empty result iterator, and subsequent subQuery2 ~ subQueryN would still evaluate to call build scorer, this is an unnecessary cost for this query if subQuery1 have already got an empty result iterator .

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            hackerwin7 hackerwin7
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: