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

DrillSideways.search yields IllegalArgEx if given IndexReader is empty

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.4, 6.0
    • modules/facet
    • None
    • New, Patch Available

    Description

      DrillSideways.create() creates either TopScoreDocCollector or TopFieldCollector with numHits = min(topN, reader.maxDoc()). When the reader is empty, these collectors throw IllegalArgEx that numHits should be > 0. While this is a correct behavior on their part, I think the behavior in DS is wrong. It's an optimization to ask for min(topN, reader.maxDoc(), i.e. if it just delegated topN all was well. So if we'd like to keep the optimization, we should at least make it min(topN,maxDoc+1), because there's nothing technically wrong from running a search against an empty index.

      Attachments

        1. LUCENE-5045.patch
          5 kB
          Shai Erera
        2. LUCENE-5045.patch
          5 kB
          Shai Erera

        Activity

          People

            shaie Shai Erera
            shaie Shai Erera
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: