Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class QueryTermScorer

    IScorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.

    Inheritance
    object
    QueryTermScorer
    Implements
    IScorer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Search.Highlight
    Assembly: Lucene.Net.Highlighter.dll
    Syntax
    public class QueryTermScorer : IScorer

    Constructors

    QueryTermScorer(WeightedTerm[])

    IScorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.

    Declaration
    public QueryTermScorer(WeightedTerm[] weightedTerms)
    Parameters
    Type Name Description
    WeightedTerm[] weightedTerms

    QueryTermScorer(Query)

    IScorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.

    Declaration
    public QueryTermScorer(Query query)
    Parameters
    Type Name Description
    Query query

    a Lucene query (ideally rewritten using Lucene.Net.Search.Query.Rewrite(Lucene.Net.Index.IndexReader) before being passed to this class and the searcher)

    QueryTermScorer(Query, IndexReader, string)

    IScorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.

    Declaration
    public QueryTermScorer(Query query, IndexReader reader, string fieldName)
    Parameters
    Type Name Description
    Query query

    a Lucene query (ideally rewritten using Lucene.Net.Search.Query.Rewrite(Lucene.Net.Index.IndexReader) before being passed to this class and the searcher)

    IndexReader reader

    used to compute IDF which can be used to a) score selected fragments better b) use graded highlights eg set font color intensity

    string fieldName

    the field on which Inverse Document Frequency (IDF) calculations are based

    QueryTermScorer(Query, string)

    IScorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.

    Declaration
    public QueryTermScorer(Query query, string fieldName)
    Parameters
    Type Name Description
    Query query

    a Lucene query (ideally rewritten using Lucene.Net.Search.Query.Rewrite(Lucene.Net.Index.IndexReader) before being passed to this class and the searcher)

    string fieldName

    the Field name which is used to match Query terms

    Properties

    FragmentScore

    FragmentScore

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

    MaxTermWeight

    The highest weighted term (useful for passing to GradientFormatter to set top end of coloring scale.

    Declaration
    public virtual float MaxTermWeight { get; }
    Property Value
    Type Description
    float

    Methods

    AllFragmentsProcessed()

    IScorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.

    Declaration
    public virtual void AllFragmentsProcessed()

    GetTokenScore()

    GetTokenScore()

    Declaration
    public virtual float GetTokenScore()
    Returns
    Type Description
    float

    Init(TokenStream)

    Init(TokenStream)

    Declaration
    public virtual TokenStream Init(TokenStream tokenStream)
    Parameters
    Type Name Description
    TokenStream tokenStream
    Returns
    Type Description
    TokenStream

    StartFragment(TextFragment)

    Called when a new fragment is started for consideration.

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

    the fragment that will be scored next

    Implements

    IScorer
    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.