Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class DefaultPassageFormatter

    Creates a formatted snippet from the top passages.

    The default implementation marks the query terms as bold, and places ellipses between unconnected passages.

    Inheritance
    System.Object
    PassageFormatter
    DefaultPassageFormatter
    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.PostingsHighlight
    Assembly: Lucene.Net.ICU.dll
    Syntax
    public class DefaultPassageFormatter : PassageFormatter

    Constructors

    | Improve this Doc View Source

    DefaultPassageFormatter()

    Creates a new DefaultPassageFormatter with the default tags.

    Declaration
    public DefaultPassageFormatter()
    | Improve this Doc View Source

    DefaultPassageFormatter(String, String, String, Boolean)

    Creates a new DefaultPassageFormatter with custom tags.

    Declaration
    public DefaultPassageFormatter(string preTag, string postTag, string ellipsis, bool escape)
    Parameters
    Type Name Description
    System.String preTag

    text which should appear before a highlighted term.

    System.String postTag

    text which should appear after a highlighted term.

    System.String ellipsis

    text which should be used to connect two unconnected passages.

    System.Boolean escape

    true if text should be html-escaped

    Fields

    | Improve this Doc View Source

    m_ellipsis

    text that will appear between two unconnected passages

    Declaration
    protected readonly string m_ellipsis
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    m_escape

    true if we should escape for html

    Declaration
    protected readonly bool m_escape
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    m_postTag

    text that will appear after highlighted terms

    Declaration
    protected readonly string m_postTag
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    m_preTag

    text that will appear before highlighted terms

    Declaration
    protected readonly string m_preTag
    Field Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    Append(StringBuilder, String, Int32, Int32)

    Appends original text to the response.

    Declaration
    protected virtual void Append(StringBuilder dest, string content, int start, int end)
    Parameters
    Type Name Description
    System.Text.StringBuilder dest

    resulting text, possibly transformed or encoded

    System.String content

    original text content

    System.Int32 start

    index of the first character in content

    System.Int32 end

    index of the character following the last character in content

    | Improve this Doc View Source

    Format(Passage[], String)

    Declaration
    public override object Format(Passage[] passages, string content)
    Parameters
    Type Name Description
    Passage[] passages
    System.String content
    Returns
    Type Description
    System.Object
    Overrides
    PassageFormatter.Format(Passage[], String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2022 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.