Show / Hide Table of Contents

    Class QueryScorer

    IScorer implementation which scores text fragments by the number of unique query terms found. This class converts appropriate Querys to SpanQuerys and attempts to score only those terms that participated in generating the 'hit' on the document.

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

    Constructors

    | Improve this Doc View Source

    QueryScorer(WeightedSpanTerm[])

    Constructs a new QueryScorer instance

    Declaration
    public QueryScorer(WeightedSpanTerm[] weightedTerms)
    Parameters
    Type Name Description
    WeightedSpanTerm[] weightedTerms

    an array of pre-created WeightedSpanTerms

    | Improve this Doc View Source

    QueryScorer(Query)

    Constructs a new QueryScorer instance

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

    Query to use for highlighting

    | Improve this Doc View Source

    QueryScorer(Query, IndexReader, String)

    Constructs a new QueryScorer instance

    Declaration
    public QueryScorer(Query query, IndexReader reader, string field)
    Parameters
    Type Name Description
    Query query

    Query to use for highlighting

    IndexReader reader

    IndexReader to use for quasi tf/idf scoring

    System.String field

    Field to highlight - pass null to ignore fields

    | Improve this Doc View Source

    QueryScorer(Query, IndexReader, String, String)

    Constructs a new QueryScorer instance

    Declaration
    public QueryScorer(Query query, IndexReader reader, string field, string defaultField)
    Parameters
    Type Name Description
    Query query

    Query to use for highlighting

    IndexReader reader

    IndexReader to use for quasi tf/idf scoring

    System.String field

    Field to highlight - pass null to ignore fields

    System.String defaultField

    The default field for queries with the field name unspecified

    | Improve this Doc View Source

    QueryScorer(Query, String)

    Constructs a new QueryScorer instance

    Declaration
    public QueryScorer(Query query, string field)
    Parameters
    Type Name Description
    Query query

    Query to use for highlighting

    System.String field

    Field to highlight - pass null to ignore fields

    | Improve this Doc View Source

    QueryScorer(Query, String, String)

    Constructs a new QueryScorer instance

    Declaration
    public QueryScorer(Query query, string field, string defaultField)
    Parameters
    Type Name Description
    Query query

    Query to use for highlighting

    System.String field

    Field to highlight - pass null to ignore fields

    System.String defaultField

    The default field for queries with the field name unspecified

    Properties

    | Improve this Doc View Source

    ExpandMultiTermQuery

    Controls whether or not multi-term queries are expanded against a MemoryIndex IndexReader. true if multi-term queries should be expanded

    Declaration
    public virtual bool ExpandMultiTermQuery { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    FragmentScore

    Declaration
    public virtual float FragmentScore { get; }
    Property Value
    Type Description
    System.Single
    See Also
    FragmentScore
    | Improve this Doc View Source

    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
    System.Single

    Methods

    | Improve this Doc View Source

    GetTokenScore()

    Declaration
    public virtual float GetTokenScore()
    Returns
    Type Description
    System.Single
    See Also
    GetTokenScore()
    | Improve this Doc View Source

    GetWeightedSpanTerm(String)

    Retrieve the WeightedSpanTerm for the specified token. Useful for passing Span information to a IFragmenter.

    Declaration
    public virtual WeightedSpanTerm GetWeightedSpanTerm(string token)
    Parameters
    Type Name Description
    System.String token

    token to get WeightedSpanTerm for

    Returns
    Type Description
    WeightedSpanTerm

    WeightedSpanTerm for token

    | Improve this Doc View Source

    Init(TokenStream)

    Declaration
    public virtual TokenStream Init(TokenStream tokenStream)
    Parameters
    Type Name Description
    TokenStream tokenStream
    Returns
    Type Description
    TokenStream
    See Also
    Init(TokenStream)
    | Improve this Doc View Source

    NewTermExtractor(String)

    Declaration
    protected virtual WeightedSpanTermExtractor NewTermExtractor(string defaultField)
    Parameters
    Type Name Description
    System.String defaultField
    Returns
    Type Description
    WeightedSpanTermExtractor
    | Improve this Doc View Source

    SetMaxDocCharsToAnalyze(Int32)

    Declaration
    public virtual void SetMaxDocCharsToAnalyze(int maxDocCharsToAnalyze)
    Parameters
    Type Name Description
    System.Int32 maxDocCharsToAnalyze
    | Improve this Doc View Source

    SetWrapIfNotCachingTokenFilter(Boolean)

    By default, TokenStreams that are not of the type CachingTokenFilter are wrapped in a CachingTokenFilter to ensure an efficient reset - if you are already using a different caching TokenStream impl and you don't want it to be wrapped, set this to false.

    Declaration
    public virtual void SetWrapIfNotCachingTokenFilter(bool wrap)
    Parameters
    Type Name Description
    System.Boolean wrap
    | Improve this Doc View Source

    StartFragment(TextFragment)

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

    Implements

    IScorer
    • Improve this Doc
    • View Source
    Back to top Copyright © 2019 Licensed to the Apache Software Foundation (ASF)