Fork me on GitHub
  • API

    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 Lucene.Net.Search.Querys to Lucene.Net.Search.Spans.SpanQuerys and attempts to score only those terms that participated in generating the 'hit' on the document.

    Inheritance
    object
    QueryScorer
    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 QueryScorer : IScorer

    Constructors

    QueryScorer(WeightedSpanTerm[])

    Constructs a new QueryScorer instance

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

    an array of pre-created WeightedSpanTerms

    QueryScorer(Query)

    Constructs a new QueryScorer instance

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

    Lucene.Net.Search.Query to use for highlighting

    QueryScorer(Query, IndexReader, string)

    Constructs a new QueryScorer instance

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

    Lucene.Net.Search.Query to use for highlighting

    IndexReader reader

    Lucene.Net.Index.IndexReader to use for quasi tf/idf scoring

    string field

    Field to highlight - pass null to ignore fields

    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

    Lucene.Net.Search.Query to use for highlighting

    IndexReader reader

    Lucene.Net.Index.IndexReader to use for quasi tf/idf scoring

    string field

    Field to highlight - pass null to ignore fields

    string defaultField

    The default field for queries with the field name unspecified

    QueryScorer(Query, string)

    Constructs a new QueryScorer instance

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

    Lucene.Net.Search.Query to use for highlighting

    string field

    Field to highlight - pass null to ignore fields

    QueryScorer(Query, string, string)

    Constructs a new QueryScorer instance

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

    Lucene.Net.Search.Query to use for highlighting

    string field

    Field to highlight - pass null to ignore fields

    string defaultField

    The default field for queries with the field name unspecified

    Properties

    ExpandMultiTermQuery

    Controls whether or not multi-term queries are expanded against a Lucene.Net.Index.Memory.MemoryIndexLucene.Net.Index.IndexReader. true if multi-term queries should be expanded

    Declaration
    public virtual bool ExpandMultiTermQuery { get; set; }
    Property Value
    Type Description
    bool

    FragmentScore

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

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

    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

    GetTokenScore()

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

    Declaration
    public virtual float GetTokenScore()
    Returns
    Type Description
    float
    See Also
    GetTokenScore()

    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
    string token

    token to get WeightedSpanTerm for

    Returns
    Type Description
    WeightedSpanTerm

    WeightedSpanTerm for token

    Init(TokenStream)

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

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

    NewTermExtractor(string)

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

    Declaration
    protected virtual WeightedSpanTermExtractor NewTermExtractor(string defaultField)
    Parameters
    Type Name Description
    string defaultField
    Returns
    Type Description
    WeightedSpanTermExtractor

    SetMaxDocCharsToAnalyze(int)

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

    Declaration
    public virtual void SetMaxDocCharsToAnalyze(int maxDocCharsToAnalyze)
    Parameters
    Type Name Description
    int maxDocCharsToAnalyze

    SetWrapIfNotCachingTokenFilter(bool)

    By default, Lucene.Net.Analysis.TokenStreams that are not of the type Lucene.Net.Analysis.CachingTokenFilter are wrapped in a Lucene.Net.Analysis.CachingTokenFilter to ensure an efficient reset - if you are already using a different caching Lucene.Net.Analysis.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
    bool wrap

    StartFragment(TextFragment)

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

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

    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.