Show / Hide Table of Contents

    Class FastVectorHighlighter

    Another highlighter implementation.

    Inheritance
    System.Object
    FastVectorHighlighter
    Namespace: Lucene.Net.Search.VectorHighlight
    Assembly: Lucene.Net.Highlighter.dll
    Syntax
    public class FastVectorHighlighter : object

    Constructors

    | Improve this Doc View Source

    FastVectorHighlighter()

    the default constructor.

    Declaration
    public FastVectorHighlighter()
    | Improve this Doc View Source

    FastVectorHighlighter(Boolean, Boolean)

    a constructor. Using SimpleFragListBuilder and ScoreOrderFragmentsBuilder.

    Declaration
    public FastVectorHighlighter(bool phraseHighlight, bool fieldMatch)
    Parameters
    Type Name Description
    System.Boolean phraseHighlight

    true or false for phrase highlighting

    System.Boolean fieldMatch

    true of false for field matching

    | Improve this Doc View Source

    FastVectorHighlighter(Boolean, Boolean, IFragListBuilder, IFragmentsBuilder)

    a constructor. A IFragListBuilder and a IFragmentsBuilder can be specified (plugins).

    Declaration
    public FastVectorHighlighter(bool phraseHighlight, bool fieldMatch, IFragListBuilder fragListBuilder, IFragmentsBuilder fragmentsBuilder)
    Parameters
    Type Name Description
    System.Boolean phraseHighlight

    true of false for phrase highlighting

    System.Boolean fieldMatch

    true of false for field matching

    IFragListBuilder fragListBuilder

    an instance of IFragmentsBuilder

    IFragmentsBuilder fragmentsBuilder

    an instance of IFragmentsBuilder

    Fields

    | Improve this Doc View Source

    DEFAULT_FIELD_MATCH

    Declaration
    public static readonly bool DEFAULT_FIELD_MATCH
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    DEFAULT_PHRASE_HIGHLIGHT

    Declaration
    public static readonly bool DEFAULT_PHRASE_HIGHLIGHT
    Field Value
    Type Description
    System.Boolean

    Properties

    | Improve this Doc View Source

    IsFieldMatch

    return whether fieldMatch or not.

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

    IsPhraseHighlight

    return whether phraseHighlight or not.

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

    PhraseLimit

    Gets or Sets the maximum number of phrases to analyze when searching for the highest-scoring phrase. The default is unlimited (int.MaxValue).

    Declaration
    public virtual int PhraseLimit { get; set; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    GetBestFragment(FieldQuery, IndexReader, Int32, String, Int32)

    return the best fragment.

    Declaration
    public string GetBestFragment(FieldQuery fieldQuery, IndexReader reader, int docId, string fieldName, int fragCharSize)
    Parameters
    Type Name Description
    FieldQuery fieldQuery

    FieldQuery object

    IndexReader reader

    of the index

    System.Int32 docId

    document id to be highlighted

    System.String fieldName

    field of the document to be highlighted

    System.Int32 fragCharSize

    the length (number of chars) of a fragment

    Returns
    Type Description
    System.String

    the best fragment (snippet) string

    | Improve this Doc View Source

    GetBestFragment(FieldQuery, IndexReader, Int32, String, Int32, IFragListBuilder, IFragmentsBuilder, String[], String[], IEncoder)

    return the best fragment.

    Declaration
    public string GetBestFragment(FieldQuery fieldQuery, IndexReader reader, int docId, string fieldName, int fragCharSize, IFragListBuilder fragListBuilder, IFragmentsBuilder fragmentsBuilder, string[] preTags, string[] postTags, IEncoder encoder)
    Parameters
    Type Name Description
    FieldQuery fieldQuery

    FieldQuery object

    IndexReader reader

    of the index

    System.Int32 docId

    document id to be highlighted

    System.String fieldName

    field of the document to be highlighted

    System.Int32 fragCharSize

    the length (number of chars) of a fragment

    IFragListBuilder fragListBuilder

    IFragListBuilder object

    IFragmentsBuilder fragmentsBuilder

    IFragmentsBuilder object

    System.String[] preTags

    pre-tags to be used to highlight terms

    System.String[] postTags

    post-tags to be used to highlight terms

    IEncoder encoder

    an encoder that generates encoded text

    Returns
    Type Description
    System.String

    the best fragment (snippet) string

    | Improve this Doc View Source

    GetBestFragments(FieldQuery, IndexReader, Int32, String, ISet<String>, Int32, Int32, IFragListBuilder, IFragmentsBuilder, String[], String[], IEncoder)

    Return the best fragments. Matches are scanned from matchedFields and turned into fragments against storedField. The highlighting may not make sense if matchedFields has matches with offsets that don't correspond features in storedField. It will outright throw a if matchedFields produces offsets outside of storedField. As such it is advisable that all matchedFields share the same source as storedField or are at least a prefix of it.

    Declaration
    public string[] GetBestFragments(FieldQuery fieldQuery, IndexReader reader, int docId, string storedField, ISet<string> matchedFields, int fragCharSize, int maxNumFragments, IFragListBuilder fragListBuilder, IFragmentsBuilder fragmentsBuilder, string[] preTags, string[] postTags, IEncoder encoder)
    Parameters
    Type Name Description
    FieldQuery fieldQuery

    FieldQuery object

    IndexReader reader

    of the index

    System.Int32 docId

    document id to be highlighted

    System.String storedField

    field of the document that stores the text

    ISet<System.String> matchedFields

    fields of the document to scan for matches

    System.Int32 fragCharSize

    the length (number of chars) of a fragment

    System.Int32 maxNumFragments

    maximum number of fragments

    IFragListBuilder fragListBuilder

    IFragListBuilder object

    IFragmentsBuilder fragmentsBuilder

    IFragmentsBuilder object

    System.String[] preTags

    pre-tags to be used to highlight terms

    System.String[] postTags

    post-tags to be used to highlight terms

    IEncoder encoder

    an encoder that generates encoded text

    Returns
    Type Description
    System.String[]

    created fragments or null when no fragments created. size of the array can be less than maxNumFragments

    | Improve this Doc View Source

    GetBestFragments(FieldQuery, IndexReader, Int32, String, Int32, Int32)

    return the best fragments.

    Declaration
    public string[] GetBestFragments(FieldQuery fieldQuery, IndexReader reader, int docId, string fieldName, int fragCharSize, int maxNumFragments)
    Parameters
    Type Name Description
    FieldQuery fieldQuery

    FieldQuery object

    IndexReader reader

    of the index

    System.Int32 docId

    document id to be highlighted

    System.String fieldName

    field of the document to be highlighted

    System.Int32 fragCharSize

    the length (number of chars) of a fragment

    System.Int32 maxNumFragments

    maximum number of fragments

    Returns
    Type Description
    System.String[]

    created fragments or null when no fragments created. size of the array can be less than maxNumFragments

    | Improve this Doc View Source

    GetBestFragments(FieldQuery, IndexReader, Int32, String, Int32, Int32, IFragListBuilder, IFragmentsBuilder, String[], String[], IEncoder)

    return the best fragments.

    Declaration
    public string[] GetBestFragments(FieldQuery fieldQuery, IndexReader reader, int docId, string fieldName, int fragCharSize, int maxNumFragments, IFragListBuilder fragListBuilder, IFragmentsBuilder fragmentsBuilder, string[] preTags, string[] postTags, IEncoder encoder)
    Parameters
    Type Name Description
    FieldQuery fieldQuery

    FieldQuery object

    IndexReader reader

    of the index

    System.Int32 docId

    document id to be highlighted

    System.String fieldName

    field of the document to be highlighted

    System.Int32 fragCharSize

    the length (number of chars) of a fragment

    System.Int32 maxNumFragments

    maximum number of fragments

    IFragListBuilder fragListBuilder

    IFragListBuilder object

    IFragmentsBuilder fragmentsBuilder

    IFragmentsBuilder object

    System.String[] preTags

    pre-tags to be used to highlight terms

    System.String[] postTags

    post-tags to be used to highlight terms

    IEncoder encoder

    an encoder that generates encoded text

    Returns
    Type Description
    System.String[]

    created fragments or null when no fragments created. size of the array can be less than maxNumFragments

    | Improve this Doc View Source

    GetFieldQuery(Query)

    create a FieldQuery object.

    Declaration
    public virtual FieldQuery GetFieldQuery(Query query)
    Parameters
    Type Name Description
    Query query

    a query

    Returns
    Type Description
    FieldQuery

    the created FieldQuery object

    | Improve this Doc View Source

    GetFieldQuery(Query, IndexReader)

    create a FieldQuery object.

    Declaration
    public virtual FieldQuery GetFieldQuery(Query query, IndexReader reader)
    Parameters
    Type Name Description
    Query query

    a query

    IndexReader reader
    Returns
    Type Description
    FieldQuery

    the created FieldQuery object

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