gate.creole.annic.apache.lucene.search
Class BooleanScorer.Collector

java.lang.Object
  extended by gate.creole.annic.apache.lucene.search.HitCollector
      extended by gate.creole.annic.apache.lucene.search.BooleanScorer.Collector
Enclosing class:
BooleanScorer

static final class BooleanScorer.Collector
extends HitCollector


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

bucketTable

private BooleanScorer.BucketTable bucketTable

mask

private int mask
Constructor Detail

BooleanScorer.Collector

public BooleanScorer.Collector(int mask,
                               BooleanScorer.BucketTable bucketTable)
Method Detail

collect

public final void collect(int doc,
                          float score)
Description copied from class: HitCollector
Called once for every non-zero scoring document, with the document number and its score.

If, 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.

Specified by:
collect in class HitCollector