Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Interface IScorer

    A IScorer is responsible for scoring a stream of tokens. These token scores can then be used to compute TextFragment scores.

    Namespace: Lucene.Net.Search.Highlight
    Assembly: Lucene.Net.Highlighter.dll
    Syntax
    public interface IScorer

    Properties

    FragmentScore

    Called when the Highlighter has no more tokens for the current fragment - the IScorer returns the weighting it has derived for the most recent fragment, typically based on the results of GetTokenScore().

    Declaration
    float FragmentScore { get; }
    Property Value
    Type Description
    float

    Methods

    GetTokenScore()

    Called for each token in the current fragment. The Highlighter will increment the Lucene.Net.Analysis.TokenStream passed to init on every call.

    Declaration
    float GetTokenScore()
    Returns
    Type Description
    float

    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)

    Init(TokenStream)

    Called to init the Scorer with a Lucene.Net.Analysis.TokenStream. You can grab references to the attributes you are interested in here and access them from GetTokenScore().

    Declaration
    TokenStream Init(TokenStream tokenStream)
    Parameters
    Type Name Description
    TokenStream tokenStream

    the Lucene.Net.Analysis.TokenStream that will be scored.

    Returns
    Type Description
    TokenStream

    either a Lucene.Net.Analysis.TokenStream that the Highlighter should continue using (eg if you read the tokenSream in this method) or null to continue using the same Lucene.Net.Analysis.TokenStream that was passed in.

    Exceptions
    Type Condition
    IOException

    If there is a low-level I/O error

    StartFragment(TextFragment)

    Called when a new fragment is started for consideration.

    Declaration
    void StartFragment(TextFragment newFragment)
    Parameters
    Type Name Description
    TextFragment newFragment

    the fragment that will be scored next

    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.