Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class PatternReplaceCharFilter

    Lucene.Net.Analysis.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
    object
    MarshalByRefObject
    TextReader
    CharFilter
    BaseCharFilter
    PatternReplaceCharFilter
    Implements
    IDisposable
    Inherited Members
    BaseCharFilter.LastCumulativeDiff
    BaseCharFilter.AddOffCorrectMap(int, int)
    CharFilter.m_input
    CharFilter.Dispose(bool)
    CharFilter.CorrectOffset(int)
    CharFilter.Skip(int)
    CharFilter.Reset()
    CharFilter.IsReady
    CharFilter.IsMarkSupported
    CharFilter.Mark(int)
    TextReader.Null
    TextReader.Close()
    TextReader.Dispose()
    TextReader.Peek()
    TextReader.Read(Span<char>)
    TextReader.ReadAsync(char[], int, int)
    TextReader.ReadAsync(Memory<char>, CancellationToken)
    TextReader.ReadBlock(char[], int, int)
    TextReader.ReadBlock(Span<char>)
    TextReader.ReadBlockAsync(char[], int, int)
    TextReader.ReadBlockAsync(Memory<char>, CancellationToken)
    TextReader.ReadLine()
    TextReader.ReadLineAsync()
    TextReader.ReadLineAsync(CancellationToken)
    TextReader.ReadToEnd()
    TextReader.ReadToEndAsync()
    TextReader.ReadToEndAsync(CancellationToken)
    TextReader.Synchronized(TextReader)
    MarshalByRefObject.GetLifetimeService()
    MarshalByRefObject.InitializeLifetimeService()
    MarshalByRefObject.MemberwiseClone(bool)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Analysis.Pattern
    Assembly: Lucene.Net.Analysis.Common.dll
    Syntax
    public class PatternReplaceCharFilter : BaseCharFilter, IDisposable

    Constructors

    PatternReplaceCharFilter(Regex, string, TextReader)

    Lucene.Net.Analysis.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

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

    PatternReplaceCharFilter(Regex, string, int, string, TextReader)

    Lucene.Net.Analysis.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

    Declaration
    [Obsolete]
    public PatternReplaceCharFilter(Regex pattern, string replacement, int maxBlockChars, string blockDelimiter, TextReader @in)
    Parameters
    Type Name Description
    Regex pattern
    string replacement
    int maxBlockChars
    string blockDelimiter
    TextReader in

    Fields

    DEFAULT_MAX_BLOCK_CHARS

    Lucene.Net.Analysis.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

    Declaration
    [Obsolete]
    public const int DEFAULT_MAX_BLOCK_CHARS = 10000
    Field Value
    Type Description
    int

    Methods

    Correct(int)

    Retrieve the corrected offset.

    Declaration
    protected override int Correct(int currentOff)
    Parameters
    Type Name Description
    int currentOff
    Returns
    Type Description
    int
    Overrides
    BaseCharFilter.Correct(int)

    Read()

    Reads the next character from the text reader and advances the character position by one character.

    Declaration
    public override int Read()
    Returns
    Type Description
    int

    The next character from the text reader, or -1 if no more characters are available. The default implementation returns -1.

    Overrides
    Lucene.Net.Analysis.CharFilter.Read()
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextReader is closed.

    IOException

    An I/O error occurs.

    Read(char[], int, int)

    Reads a specified maximum number of characters from the current reader and writes the data to a buffer, beginning at the specified index.

    Declaration
    public override int Read(char[] cbuf, int off, int len)
    Parameters
    Type Name Description
    char[] cbuf
    int off
    int len
    Returns
    Type Description
    int

    The number of characters that have been read. The number will be less than or equal to count, depending on whether the data is available within the reader. This method returns 0 (zero) if it is called when no more characters are left to read.

    Overrides
    CharFilter.Read(char[], int, int)
    Exceptions
    Type Condition
    ArgumentNullException

    buffer is null.

    ArgumentException

    The buffer length minus index is less than count.

    ArgumentOutOfRangeException

    index or count is negative.

    ObjectDisposedException

    The TextReader is closed.

    IOException

    An I/O error occurs.

    Implements

    IDisposable
    Back to top Copyright © 2024 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.