org.apache.lucene.search.highlight

Interface Scorer

public interface Scorer

Adds to the score for a fragment based on its tokens

Author: mark@searcharea.co.uk

Method Summary
floatgetFragmentScore()
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 tokens passed to getTokenScore().
floatgetTokenScore(Token token)
Called for each token in the current fragment
voidstartFragment(TextFragment newFragment)
called when a new fragment is started for consideration

Method Detail

getFragmentScore

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 tokens passed to getTokenScore().

getTokenScore

public float getTokenScore(Token token)
Called for each token in the current fragment

Parameters: token The token to be scored

Returns: a score which is passed to the Highlighter class to influence the mark-up of the text (this return value is NOT used to score the fragment)

startFragment

public void startFragment(TextFragment newFragment)
called when a new fragment is started for consideration

Parameters: newFragment

Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.