You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Guo Song (JIRA)" <ji...@apache.org> on 2013/05/19 07:09:16 UTC
[jira] [Created] (LUCENE-5008) The difference between totalHits and
scoreDocs.length of TopDocs
Guo Song created LUCENE-5008:
--------------------------------
Summary: The difference between totalHits and scoreDocs.length of TopDocs
Key: LUCENE-5008
URL: https://issues.apache.org/jira/browse/LUCENE-5008
Project: Lucene - Core
Issue Type: Bug
Components: core/search
Affects Versions: 4.3
Reporter: Guo Song
TopDocs hits = searcher.search(query, N);
hits.totalHits is not equal to hits.scoreDocs.length in lucene whose version is 4.3.0
when I write the fllowing codes:
for (int i = 0; i < hits.totalHits; i++) {
int id = hits.scoreDocs[i].doc;
//...
}
It may throw ArrayIndexOutOfBoundsException, but in version 4.0.0, the value of hits.totalHits and the value of hits.scoreDocs.length are qual!
And I think they should be qual!
Thank you!
--
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