org.apache.lucene.search.highlight

Interface Scorer

    • Method Detail

      • startFragment

        void startFragment(TextFragment newFragment)
        Called when a new fragment is started for consideration.
        Parameters:
        newFragment - the fragment that will be scored next
      • getTokenScore

        float getTokenScore()
        Called for each token in the current fragment. The Highlighter will increment the TokenStream passed to init on every call.
        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 results of getTokenScore().