|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.creole.annic.apache.lucene.search.HitCollector
gate.creole.annic.apache.lucene.search.BooleanScorer.Collector
static final class BooleanScorer.Collector
| Field Summary | |
|---|---|
private BooleanScorer.BucketTable |
bucketTable
|
private int |
mask
|
| Constructor Summary | |
|---|---|
BooleanScorer.Collector(int mask,
BooleanScorer.BucketTable bucketTable)
|
|
| Method Summary | |
|---|---|
void |
collect(int doc,
float score)
Called once for every non-zero scoring document, with the document number and its score. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private BooleanScorer.BucketTable bucketTable
private int mask
| Constructor Detail |
|---|
public BooleanScorer.Collector(int mask,
BooleanScorer.BucketTable bucketTable)
| Method Detail |
|---|
public final void collect(int doc,
float score)
HitCollectorIf, for example, an application wished to collect all of the hits for a query in a BitSet, then it might:
Searcher searcher = new IndexSearcher(indexReader);
final BitSet bits = new BitSet(indexReader.maxDoc());
searcher.search(query, new HitCollector() {
public void collect(int doc, float score) {
bits.set(doc);
}
});
Note: This is called in an inner search loop. For good search
performance, implementations of this method should not call
Searchable.doc(int) or
IndexReader.document(int) on every
document number encountered. Doing so can slow searches by an order
of magnitude or more.
Note: The score passed to this method is a raw score.
In other words, the score will not necessarily be a float whose value is
between 0 and 1.
collect in class HitCollector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||