anl.aida.ae.lucene
Class TermScorer

java.lang.Object
  extended by anl.aida.ae.lucene.TermScorer

public class TermScorer
extends java.lang.Object

Iterates through Terms in a Lucene Index an applies a function to the term data.


Field Summary
private static int BUFF_SIZE
           
private static int CACHE_SIZE
           
private  int[] docs
           
private  int[] freqs
           
private  float[] scoreCache
           
private  org.apache.lucene.search.Similarity similarity
           
private static java.util.Set<java.lang.String> unscoredFields
           
 
Constructor Summary
TermScorer()
          Creates a new TermIterator.
 
Method Summary
 void apply(org.apache.lucene.index.IndexReader reader, TermFunction func)
          Iterates over all the Terms in the index and applies the specified function to them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_SIZE

private static final int CACHE_SIZE
See Also:
Constant Field Values

BUFF_SIZE

private static final int BUFF_SIZE
See Also:
Constant Field Values

docs

private int[] docs

freqs

private int[] freqs

scoreCache

private float[] scoreCache

similarity

private org.apache.lucene.search.Similarity similarity

unscoredFields

private static java.util.Set<java.lang.String> unscoredFields
Constructor Detail

TermScorer

public TermScorer()
Creates a new TermIterator.

Method Detail

apply

public void apply(org.apache.lucene.index.IndexReader reader,
                  TermFunction func)
           throws java.io.IOException,
                  AIDAException
Iterates over all the Terms in the index and applies the specified function to them. The order of iteration is:

 func.init();
 for all Terms:
     func.newTerm();
     for all Documents:
        func.apply();
 

func.done();

Note that terms are distinguished by text and field. So two terms may have the same text but be indifferent fields.

Parameters:
reader - the reader to read the index with.
func - the function to apply to the Terms.
Throws:
java.io.IOException - if there is an error iterating over the index
AIDAException - if there is an error with the TermFunction