[
https://issues.apache.org/jira/browse/LUCENE-5045?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Shai Erera updated LUCENE-5045:
-------------------------------
Attachment: LUCENE-5045.patch
Patch adds a test which reproduces the problem and fixes DS to modify topN to
min(topN,maxDoc) only if maxDoc > 0.
I intend to commit it shortly.
> 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
> Attachments: LUCENE-5045.patch
>
>
> 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]