You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2013/06/09 14:29:20 UTC

[jira] [Commented] (LUCENE-5045) DrillSideways.create yields IllegalArgEx if given IndexReader is empty

    [ https://issues.apache.org/jira/browse/LUCENE-5045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13679023#comment-13679023 ] 

Michael McCandless commented on LUCENE-5045:
--------------------------------------------

+1, thanks Shai!
                
> 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, 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org