Save This Page
Home » lucene-3.0.1-src » org.apache » lucene » search » highlight » [javadoc | source]
org.apache.lucene.search.highlight
public interface: Scorer [javadoc | source]

All Known Implementing Classes:
    QueryTermScorer, QueryScorer, SpanScorer

A Scorer is responsible for scoring a stream of tokens. These token scores can then be used to compute TextFragment scores.
Method from org.apache.lucene.search.highlight.Scorer Summary:
getFragmentScore,   getTokenScore,   init,   startFragment
Method from org.apache.lucene.search.highlight.Scorer Detail:
 public float getFragmentScore()
    Called when the Highlighter has no more tokens for the current fragment - the Scorer returns the weighting it has derived for the most recent fragment, typically based on the results of #getTokenScore() .
 public float getTokenScore()
    Called for each token in the current fragment. The Highlighter will increment the TokenStream passed to init on every call.
 public TokenStream init(TokenStream tokenStream) throws IOException
    Called to init the Scorer with a TokenStream . You can grab references to the attributes you are interested in here and access them from #getTokenScore() .
 public  void startFragment(TextFragment newFragment)
    Called when a new fragment is started for consideration.