Show / Hide Table of Contents

    Class PatternReplaceCharFilter

    CharFilter that uses a regular expression for the target of replace string. The pattern match will be done in each "block" in char stream.

    ex1) source="aa bb aa bb", pattern="(aa)\s+(bb)" replacement="$1#$2" output="aa#bb aa#bb"

    NOTE: If you produce a phrase that has different length to source string and the field is used for highlighting for a term of the phrase, you will face a trouble.

    ex2) source="aa123bb", pattern="(aa)\d+(bb)" replacement="$1 $2" output="aa bb" and you want to search bb and highlight it, you will get highlight snippet="aa1<em>23bb</em>"

    @since Solr 1.5

    Inheritance
    System.Object
    CharFilter
    BaseCharFilter
    PatternReplaceCharFilter
    Inherited Members
    BaseCharFilter.LastCumulativeDiff
    BaseCharFilter.AddOffCorrectMap(Int32, Int32)
    CharFilter.m_input
    CharFilter.Dispose(Boolean)
    CharFilter.CorrectOffset(Int32)
    CharFilter.Skip(Int32)
    CharFilter.Reset()
    CharFilter.IsReady
    CharFilter.IsMarkSupported
    CharFilter.Mark(Int32)
    Namespace: Lucene.Net.Analysis.Pattern
    Assembly: Lucene.Net.Analysis.Common.dll
    Syntax
    public class PatternReplaceCharFilter : BaseCharFilter

    Constructors

    | Improve this Doc View Source

    PatternReplaceCharFilter(Regex, String, Int32, String, TextReader)

    Declaration
    public PatternReplaceCharFilter(Regex pattern, string replacement, int maxBlockChars, string blockDelimiter, TextReader in)
    Parameters
    Type Name Description
    Regex pattern
    System.String replacement
    System.Int32 maxBlockChars
    System.String blockDelimiter
    TextReader in
    | Improve this Doc View Source

    PatternReplaceCharFilter(Regex, String, TextReader)

    Declaration
    public PatternReplaceCharFilter(Regex pattern, string replacement, TextReader in)
    Parameters
    Type Name Description
    Regex pattern
    System.String replacement
    TextReader in

    Fields

    | Improve this Doc View Source

    DEFAULT_MAX_BLOCK_CHARS

    Declaration
    public const int DEFAULT_MAX_BLOCK_CHARS = null
    Field Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    Correct(Int32)

    Declaration
    protected override int Correct(int currentOff)
    Parameters
    Type Name Description
    System.Int32 currentOff
    Returns
    Type Description
    System.Int32
    Overrides
    BaseCharFilter.Correct(Int32)
    | Improve this Doc View Source

    Read()

    Declaration
    public override int Read()
    Returns
    Type Description
    System.Int32
    Overrides
    CharFilter.Read()
    | Improve this Doc View Source

    Read(Char[], Int32, Int32)

    Declaration
    public override int Read(char[] cbuf, int off, int len)
    Parameters
    Type Name Description
    System.Char[] cbuf
    System.Int32 off
    System.Int32 len
    Returns
    Type Description
    System.Int32
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)