mirror of https://github.com/apache/lucene.git
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:
parent
7cd7ca05a1
commit
19a3915b3c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue