[
https://issues.apache.org/jira/browse/LUCENE-5128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13721857#comment-13721857
]
Shai Erera commented on LUCENE-5128:
------------------------------------
Hehe, no problem. Your report uncovered a potential misuse of the searchAfter
API. You should always pass the last ScoreDoc that you obtained from the last
search. Your code above uses it correctly, although you should check for
scoreDocs.length == 0, as you noted.
After enforcing that limitation in IndexSearcher, one test misused the API and
had to be fixed as well.
So your report, while a false alarm, led to an improvement of the API :). Thank
you for that!
> Calling IndexSearcher.searchAfter beyond the number of stored documents
> causes ArrayIndexOutOfBoundsException
> -------------------------------------------------------------------------------------------------------------
>
> Key: LUCENE-5128
> URL: https://issues.apache.org/jira/browse/LUCENE-5128
> Project: Lucene - Core
> Issue Type: Bug
> Components: core/search
> Affects Versions: 4.2
> Reporter: crocket
> Assignee: Shai Erera
> Fix For: 5.0, 4.5
>
> Attachments: LUCENE-5128.patch, LUCENE-5128.patch
>
>
> ArrayIndexOutOfBoundsException makes it harder to reason about the cause.
> Is there a better way to notify programmers of the cause?
--
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]