Added accessor method to get HitDoc global id from Hits.

This id needs to be used in sorting.


git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149781 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Peter Carlson 2002-06-20 14:32:08 +00:00
parent 7cd7ca05a1
commit 19a3915b3c
1 changed files with 6 additions and 0 deletions

View File

@ -132,6 +132,12 @@ public final class Hits {
public final float score(int n) throws IOException {
return hitDoc(n).score;
}
/** Returns the id for the nth document in this set. */
public final float id(int n) throws IOException {
return hitDoc(n).id;
}
private final HitDoc hitDoc(int n) throws IOException {
if (n >= length)