Scorer (Lucene 2.4.1 API)
Keywords: org.apache.lucene.search.highlight.Scorer interface

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.lucene.search.highlight
Interface Scorer

All Known Implementing Classes:
  QueryScorer, SpanScorer

    public interface Scorer

Adds to the score for a fragment based on its tokens

Method Summary
`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().
`float` | `getTokenScore(Token token)` Called for each token in the current fragment
`void` | `startFragment(TextFragment newFragment)` called when a new fragment is started for consideration

Method Detail

### startFragment

    void startFragment(TextFragment newFragment)

  called when a new fragment is started for consideration

  Parameters:
    `newFragment` -

### getTokenScore

    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)

### getFragmentScore

    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().

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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