org.apache.lucene.search
public final class Hits extends Object
Method Summary | |
---|---|
Document | doc(int n) Returns the stored fields of the nth document in this set.
|
int | id(int n) Returns the id for the nth document in this set. |
Iterator | iterator()
Returns a HitIterator to navigate the Hits. |
int | length() Returns the total number of hits available in this set. |
float | score(int n) Returns the score for the nth document in this set. |
Documents are cached, so that repeated requests for the same element may return the same Document object.
Caution: Iterate only over the hits needed. Iterating over all hits is generally not desirable and may be the source of performance issues.