Search Results for

    Show / Hide Table of Contents

    Class HighlightDescriptor<T>

    Inheritance
    object
    DescriptorBase<HighlightDescriptor<T>, IHighlight>
    HighlightDescriptor<T>
    Implements
    IDescriptor
    IHighlight
    Inherited Members
    DescriptorBase<HighlightDescriptor<T>, IHighlight>.Self
    DescriptorBase<HighlightDescriptor<T>, IHighlight>.Assign<TValue>(TValue, Action<IHighlight, TValue>)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: OpenSearch.Client
    Assembly: OpenSearch.Client.dll
    Syntax
    public class HighlightDescriptor<T> : DescriptorBase<HighlightDescriptor<T>, IHighlight>, IDescriptor, IHighlight where T : class
    Type Parameters
    Name Description
    T

    Methods

    | Edit this page View Source

    BoundaryChars(string)

    Defines what constitutes a boundary for highlighting when using the fast vector highlighter. It's a single string with each boundary character defined in it. It defaults to .,!? \t\n.

    Declaration
    public HighlightDescriptor<T> BoundaryChars(string boundaryChars)
    Parameters
    Type Name Description
    string boundaryChars
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    BoundaryMaxScan(int?)

    Controls how far to look for boundary characters. Defaults to 20.

    Declaration
    public HighlightDescriptor<T> BoundaryMaxScan(int? boundaryMaxScan)
    Parameters
    Type Name Description
    int? boundaryMaxScan
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    BoundaryScanner(BoundaryScanner?)

    When highlighting a field using the unified highlighter or the fast vector highlighter, you can specify how to break the highlighted fragments using boundary_scanner

    Declaration
    public HighlightDescriptor<T> BoundaryScanner(BoundaryScanner? boundaryScanner)
    Parameters
    Type Name Description
    BoundaryScanner? boundaryScanner
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    BoundaryScannerLocale(string)

    You can further specify boundary_scanner_locale to control which Locale is used to search the text for these boundaries.

    Declaration
    public HighlightDescriptor<T> BoundaryScannerLocale(string locale)
    Parameters
    Type Name Description
    string locale
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    Encoder(HighlighterEncoder?)

    Define how highlighted text will be encoded. It can be either default (no encoding) or html (will escape html, if you use html highlighting tags).

    Declaration
    public HighlightDescriptor<T> Encoder(HighlighterEncoder? encoder)
    Parameters
    Type Name Description
    HighlighterEncoder? encoder
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    Fields(params Func<HighlightFieldDescriptor<T>, IHighlightField>[])

    Declaration
    public HighlightDescriptor<T> Fields(params Func<HighlightFieldDescriptor<T>, IHighlightField>[] fieldHighlighters)
    Parameters
    Type Name Description
    Func<HighlightFieldDescriptor<T>, IHighlightField>[] fieldHighlighters
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    FragmentOffset(int?)

    Controls the margin to start highlighting from when using the fast vector highlighter

    Declaration
    public HighlightDescriptor<T> FragmentOffset(int? fragmentOffset)
    Parameters
    Type Name Description
    int? fragmentOffset
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    FragmentSize(int?)

    The size of the highlighted fragment, in characters. Defaults to 100

    Declaration
    public HighlightDescriptor<T> FragmentSize(int? fragmentSize)
    Parameters
    Type Name Description
    int? fragmentSize
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    Fragmenter(HighlighterFragmenter?)

    Fragmenter can control how text should be broken up in highlight snippets. However, this option is applicable only for the Plain Highlighter

    Declaration
    public HighlightDescriptor<T> Fragmenter(HighlighterFragmenter? fragmenter)
    Parameters
    Type Name Description
    HighlighterFragmenter? fragmenter
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    HighlightQuery(Func<QueryContainerDescriptor<T>, QueryContainer>)

    The query to use for highlighting

    Declaration
    public HighlightDescriptor<T> HighlightQuery(Func<QueryContainerDescriptor<T>, QueryContainer> query)
    Parameters
    Type Name Description
    Func<QueryContainerDescriptor<T>, QueryContainer> query
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    MaxAnalyzerOffset(int?)

    If this setting is set to a non-negative value, the highlighting stops at this defined maximum limit, and the rest of the text is not processed, thus not highlighted and no error is returned.

    Declaration
    public HighlightDescriptor<T> MaxAnalyzerOffset(int? maxAnalyzerOffset)
    Parameters
    Type Name Description
    int? maxAnalyzerOffset
    Returns
    Type Description
    HighlightDescriptor<T>
    Remarks

    Introduced in OpenSearch 2.2

    | Edit this page View Source

    MaxFragmentLength(int?)

    Declaration
    public HighlightDescriptor<T> MaxFragmentLength(int? maxFragmentLength)
    Parameters
    Type Name Description
    int? maxFragmentLength
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    NoMatchSize(int?)

    In the case where there is no matching fragment to highlight, the default is to not return anything. Instead, we can return a snippet of text from the beginning of the field by setting no_match_size (default 0) to the length of the text that you want returned. The actual length may be shorter or longer than specified as it tries to break on a word boundary.

    Declaration
    public HighlightDescriptor<T> NoMatchSize(int? noMatchSize)
    Parameters
    Type Name Description
    int? noMatchSize
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    NumberOfFragments(int?)

    The maximum number of fragments to return. Defaults to 5.

    Declaration
    public HighlightDescriptor<T> NumberOfFragments(int? numberOfFragments)
    Parameters
    Type Name Description
    int? numberOfFragments
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    Order(HighlighterOrder?)

    The order in which highlighted fragments are sorted

    Declaration
    public HighlightDescriptor<T> Order(HighlighterOrder? order)
    Parameters
    Type Name Description
    HighlighterOrder? order
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    PostTags(IEnumerable<string>)

    Controls the post tag in which to wrap highights. By default, the highlighting will wrap highlighted text in <em> and </em>. Using the fast vector highlighter, there can be more tags, and the importance is ordered.

    Declaration
    public HighlightDescriptor<T> PostTags(IEnumerable<string> postTags)
    Parameters
    Type Name Description
    IEnumerable<string> postTags
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    PostTags(params string[])

    Controls the post tag in which to wrap highights. By default, the highlighting will wrap highlighted text in <em> and </em>. Using the fast vector highlighter, there can be more tags, and the importance is ordered.

    Declaration
    public HighlightDescriptor<T> PostTags(params string[] postTags)
    Parameters
    Type Name Description
    string[] postTags
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    PreTags(IEnumerable<string>)

    Controls the pre tag in which to wrap highights. By default, the highlighting will wrap highlighted text in <em> and </em>. Using the fast vector highlighter, there can be more tags, and the importance is ordered.

    Declaration
    public HighlightDescriptor<T> PreTags(IEnumerable<string> preTags)
    Parameters
    Type Name Description
    IEnumerable<string> preTags
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    PreTags(params string[])

    Controls the pre tag in which to wrap highights. By default, the highlighting will wrap highlighted text in <em> and </em>. Using the fast vector highlighter, there can be more tags, and the importance is ordered.

    Declaration
    public HighlightDescriptor<T> PreTags(params string[] preTags)
    Parameters
    Type Name Description
    string[] preTags
    Returns
    Type Description
    HighlightDescriptor<T>
    | Edit this page View Source

    RequireFieldMatch(bool?)

    Use a specific "tag" schemas.

    Declaration
    public HighlightDescriptor<T> RequireFieldMatch(bool? requireFieldMatch = true)
    Parameters
    Type Name Description
    bool? requireFieldMatch
    Returns
    Type Description
    HighlightDescriptor<T>
    Remarks

    Currently a single schema called "styled" with the following pre_tags: <em class="hlt1">, <em class="hlt2">, <em class="hlt3">, <em class="hlt4">, <em class="hlt5">, <em class="hlt6">, <em class="hlt7">, <em class="hlt8">, <em class="hlt9">, <em class="hlt10">

    | Edit this page View Source

    TagsSchema(HighlighterTagsSchema?)

    Use a specific "tag" schemas.

    Declaration
    public HighlightDescriptor<T> TagsSchema(HighlighterTagsSchema? schema)
    Parameters
    Type Name Description
    HighlighterTagsSchema? schema
    Returns
    Type Description
    HighlightDescriptor<T>
    Remarks

    Currently a single schema called "styled" with the following pre_tags: <em class="hlt1">, <em class="hlt2">, <em class="hlt3">, <em class="hlt4">, <em class="hlt5">, <em class="hlt6">, <em class="hlt7">, <em class="hlt8">, <em class="hlt9">, <em class="hlt10">

    Implements

    IDescriptor
    IHighlight

    Extension Methods

    SuffixExtensions.Suffix(object, string)
    • Edit this page
    • View Source
    In this article
    • Methods
      • BoundaryChars(string)
      • BoundaryMaxScan(int?)
      • BoundaryScanner(BoundaryScanner?)
      • BoundaryScannerLocale(string)
      • Encoder(HighlighterEncoder?)
      • Fields(params Func<HighlightFieldDescriptor<T>, IHighlightField>[])
      • FragmentOffset(int?)
      • FragmentSize(int?)
      • Fragmenter(HighlighterFragmenter?)
      • HighlightQuery(Func<QueryContainerDescriptor<T>, QueryContainer>)
      • MaxAnalyzerOffset(int?)
      • MaxFragmentLength(int?)
      • NoMatchSize(int?)
      • NumberOfFragments(int?)
      • Order(HighlighterOrder?)
      • PostTags(IEnumerable<string>)
      • PostTags(params string[])
      • PreTags(IEnumerable<string>)
      • PreTags(params string[])
      • RequireFieldMatch(bool?)
      • TagsSchema(HighlighterTagsSchema?)
    • Implements
    • Extension Methods
    Back to top Generated by DocFX