Show / Hide Table of Contents

    Class WeightedSpanTermExtractor

    Class used to extract WeightedSpanTerms from a Query based on whether Terms from the Query are contained in a supplied TokenStream.

    Inheritance
    System.Object
    WeightedSpanTermExtractor
    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 WeightedSpanTermExtractor

    Constructors

    | Improve this Doc View Source

    WeightedSpanTermExtractor()

    Declaration
    public WeightedSpanTermExtractor()
    | Improve this Doc View Source

    WeightedSpanTermExtractor(String)

    Declaration
    public WeightedSpanTermExtractor(string defaultField)
    Parameters
    Type Name Description
    System.String defaultField

    Properties

    | Improve this Doc View Source

    ExpandMultiTermQuery

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

    IsCachedTokenStream

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

    TokenStream

    Declaration
    public virtual TokenStream TokenStream { get; }
    Property Value
    Type Description
    TokenStream

    Methods

    | Improve this Doc View Source

    CollectSpanQueryFields(SpanQuery, ISet<String>)

    Declaration
    protected virtual void CollectSpanQueryFields(SpanQuery spanQuery, ISet<string> fieldNames)
    Parameters
    Type Name Description
    SpanQuery spanQuery
    System.Collections.Generic.ISet<System.String> fieldNames
    | Improve this Doc View Source

    Extract(Query, IDictionary<String, WeightedSpanTerm>)

    Fills a with WeightedSpanTerms using the terms from the supplied query.

    Declaration
    protected virtual void Extract(Query query, IDictionary<string, WeightedSpanTerm> terms)
    Parameters
    Type Name Description
    Query query

    Query to extract Terms from

    System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm> terms

    Map to place created WeightedSpanTerms in

    Exceptions
    Type Condition
    System.IO.IOException

    If there is a low-level I/O error

    | Improve this Doc View Source

    ExtractUnknownQuery(Query, IDictionary<String, WeightedSpanTerm>)

    Declaration
    protected virtual void ExtractUnknownQuery(Query query, IDictionary<string, WeightedSpanTerm> terms)
    Parameters
    Type Name Description
    Query query
    System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm> terms
    | Improve this Doc View Source

    ExtractWeightedSpanTerms(IDictionary<String, WeightedSpanTerm>, SpanQuery)

    Fills a with WeightedSpanTerms using the terms from the supplied SpanQuery.

    Declaration
    protected virtual void ExtractWeightedSpanTerms(IDictionary<string, WeightedSpanTerm> terms, SpanQuery spanQuery)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm> terms

    to place created WeightedSpanTerms in

    SpanQuery spanQuery

    SpanQuery to extract Terms from

    Exceptions
    Type Condition
    System.IO.IOException

    If there is a low-level I/O error

    | Improve this Doc View Source

    ExtractWeightedTerms(IDictionary<String, WeightedSpanTerm>, Query)

    Fills a with WeightedSpanTerms using the terms from the supplied SpanQuery.

    Declaration
    protected virtual void ExtractWeightedTerms(IDictionary<string, WeightedSpanTerm> terms, Query query)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm> terms

    to place created WeightedSpanTerms in

    Query query

    Query to extract Terms from

    Exceptions
    Type Condition
    System.IO.IOException

    If there is a low-level I/O error

    | Improve this Doc View Source

    FieldNameComparer(String)

    Necessary to implement matches for queries against Lucene.Net.Search.Highlight.WeightedSpanTermExtractor.defaultField

    Declaration
    protected virtual bool FieldNameComparer(string fieldNameToCheck)
    Parameters
    Type Name Description
    System.String fieldNameToCheck
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    GetLeafContext()

    Declaration
    protected virtual AtomicReaderContext GetLeafContext()
    Returns
    Type Description
    AtomicReaderContext
    | Improve this Doc View Source

    GetWeightedSpanTerms(Query, TokenStream)

    Creates an from the given Query and TokenStream.

    Declaration
    public virtual IDictionary<string, WeightedSpanTerm> GetWeightedSpanTerms(Query query, TokenStream tokenStream)
    Parameters
    Type Name Description
    Query query

    Query that caused hit

    TokenStream tokenStream

    TokenStream of text to be highlighted

    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm>

    Map containing WeightedSpanTerms

    Exceptions
    Type Condition
    System.IO.IOException

    If there is a low-level I/O error

    | Improve this Doc View Source

    GetWeightedSpanTerms(Query, TokenStream, String)

    Creates an from the given Query and TokenStream.

    Declaration
    public virtual IDictionary<string, WeightedSpanTerm> GetWeightedSpanTerms(Query query, TokenStream tokenStream, string fieldName)
    Parameters
    Type Name Description
    Query query

    Query that caused hit

    TokenStream tokenStream

    TokenStream of text to be highlighted

    System.String fieldName

    restricts Term's used based on field name

    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm>

    Map containing WeightedSpanTerms

    Exceptions
    Type Condition
    System.IO.IOException

    If there is a low-level I/O error

    | Improve this Doc View Source

    GetWeightedSpanTermsWithScores(Query, TokenStream, String, IndexReader)

    Creates an from the given Query and TokenStream. Uses a supplied IndexReader to properly Weight terms (for gradient highlighting).

    Declaration
    public virtual IDictionary<string, WeightedSpanTerm> GetWeightedSpanTermsWithScores(Query query, TokenStream tokenStream, string fieldName, IndexReader reader)
    Parameters
    Type Name Description
    Query query

    Query that caused hit

    TokenStream tokenStream

    TokenStream of text to be highlighted

    System.String fieldName

    restricts Term's used based on field name

    IndexReader reader

    to use for scoring

    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm>

    Map of WeightedSpanTerms with quasi tf/idf scores

    Exceptions
    Type Condition
    System.IO.IOException

    If there is a low-level I/O error

    | Improve this Doc View Source

    MustRewriteQuery(SpanQuery)

    Declaration
    protected virtual bool MustRewriteQuery(SpanQuery spanQuery)
    Parameters
    Type Name Description
    SpanQuery spanQuery
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    SetMaxDocCharsToAnalyze(Int32)

    Declaration
    protected 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 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
    Back to top Copyright © 2019 Licensed to the Apache Software Foundation (ASF)