| java.lang.Object org.apache.lucene.search.Hits
Hits | final public class Hits (Code) | | A ranked list of documents, used to hold search results.
Caution: Iterate only over the hits needed. Iterating over all
hits is generally not desirable and may be the source of
performance issues. If you need to iterate over many or all hits, consider
using the search method that takes a
HitCollector .
Note: Deleting matching documents concurrently with traversing
the hits, might, when deleting hits that were not yet retrieved, decrease
Hits.length() . In such case,
java.util.ConcurrentModificationException ConcurrentModificationException is thrown when accessing hit n ≥ current_
Hits.length()
(but n <
Hits.length() _at_start).
|
Method Summary | |
final public Document | doc(int n) Returns the stored fields of the nth document in this set. | final public int | id(int n) Returns the id for the nth document in this set. | public Iterator | iterator() Returns a
HitIterator to navigate the Hits. | final public int | length() Returns the total number of hits available in this set. | final public float | score(int n) Returns the score for the nth document in this set. |
debugCheckedForDeletions | boolean debugCheckedForDeletions(Code) | | |
id | final public int id(int n) throws IOException(Code) | | Returns the id for the nth document in this set.
Note that ids may change when the index changes, so you cannot
rely on the id to be stable.
|
iterator | public Iterator iterator()(Code) | | Returns a
HitIterator to navigate the Hits. Each item returned
from
Iterator.next is a
Hit .
Caution: Iterate only over the hits needed. Iterating over all
hits is generally not desirable and may be the source of
performance issues. If you need to iterate over many or all hits, consider
using a search method that takes a
HitCollector .
|
length | final public int length()(Code) | | Returns the total number of hits available in this set.
|
score | final public float score(int n) throws IOException(Code) | | Returns the score for the nth document in this set.
|
|
|