Shai Erera created LUCENE-5045:
----------------------------------

             Summary: DrillSideways.create yields IllegalArgEx if given 
IndexReader is empty
                 Key: LUCENE-5045
                 URL: https://issues.apache.org/jira/browse/LUCENE-5045
             Project: Lucene - Core
          Issue Type: Bug
          Components: modules/facet
            Reporter: Shai Erera
            Assignee: Shai Erera


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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to