Mailing List Archive

cvs commit: jakarta-lucene/src/java/org/apache/lucene/search Hits.java
carlson 2002/06/20 07:32:09

Modified: src/java/org/apache/lucene/search Hits.java
Log:
Added accessor method to get HitDoc global id from Hits. This id needs to be used in sorting.

Revision Changes Path
1.2 +6 -0 jakarta-lucene/src/java/org/apache/lucene/search/Hits.java

Index: Hits.java
===================================================================
RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/Hits.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Hits.java 18 Sep 2001 16:29:57 -0000 1.1
+++ Hits.java 20 Jun 2002 14:32:08 -0000 1.2
@@ -132,6 +132,12 @@
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)




--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>