You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "crocket (JIRA)" <ji...@apache.org> on 2013/07/28 01:43:48 UTC
[jira] [Comment Edited] (LUCENE-5128) Calling
IndexSearcher.searchAfter beyond the number of stored documents causes
ArrayIndexOutOfBoundsException
[ https://issues.apache.org/jira/browse/LUCENE-5128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13721801#comment-13721801 ]
crocket edited comment on LUCENE-5128 at 7/27/13 11:41 PM:
-----------------------------------------------------------
Man, I was so foolish.
It was my mistake.
{noformat}TopDocs searchResult=searcher.search(query, hitsPerPage, sort);
for(Integer p=1; p<page; ++p) {
searchResult=searcher.searchAfter(
searchResult.scoreDocs[searchResult.scoreDocs.length-1],
query, hitsPerPage, sort);
System.out.println(searchResult.scoreDocs.length);
}{noformat}
In the above code snippet, searchResult.scoreDocs.length becomes 0 when I search beyond the number of documents.
But my code executes searchResult.scoreDocs[searchResult.scoreDocs.length-1] even after searchResult.scoreDocs.length becomes 0.
That's why I faced that exception.
Sorry for that.
if I reported a false issue, what issue did you solve, then?
was (Author: crocket):
Man, I was so foolish.
It was my mistake.
{noformat}TopDocs searchResult=searcher.search(query, hitsPerPage, sort);
for(Integer p=1; p<page; ++p) {
searchResult=searcher.searchAfter(
searchResult.scoreDocs[searchResult.scoreDocs.length-1],
query, hitsPerPage, sort);
System.out.println(searchResult.scoreDocs.length);
}{noformat}
In the above code snippet, searchResult.scoreDocs.length becomes 0 when I search beyond the number of documents.
But my code executes searchResult.scoreDocs[searchResult.scoreDocs.length-1] even if searchResult.scoreDocs.length becomes 0.
That's why I faced that exception.
Sorry for that.
if I reported a false issue, what issue did you solve, then?
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org