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
Implements
System.IDisposable
Inherited Members
System.IO.TextReader.Null
System.IO.TextReader.Dispose()
System.IO.TextReader.Peek()
System.IO.TextReader.ReadAsync(System.Char[], System.Int32, System.Int32)
System.IO.TextReader.ReadBlock(System.Char[], System.Int32, System.Int32)
System.IO.TextReader.ReadBlockAsync(System.Char[], System.Int32, System.Int32)
System.IO.TextReader.ReadLine()
System.IO.TextReader.ReadLineAsync()
System.IO.TextReader.ReadToEnd()
System.IO.TextReader.ReadToEndAsync()
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.Analysis.Pattern
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public class PatternReplaceCharFilter : BaseCharFilter, IDisposable
Constructors
| Improve this Doc View SourcePatternReplaceCharFilter(Regex, String, Int32, String, TextReader)
Declaration
[Obsolete]
public PatternReplaceCharFilter(Regex pattern, string replacement, int maxBlockChars, string blockDelimiter, TextReader in)
Parameters
Type | Name | Description |
---|---|---|
System.Text.RegularExpressions.Regex | pattern | |
System.String | replacement | |
System.Int32 | maxBlockChars | |
System.String | blockDelimiter | |
System.IO.TextReader | in |
PatternReplaceCharFilter(Regex, String, TextReader)
Declaration
public PatternReplaceCharFilter(Regex pattern, string replacement, TextReader in)
Parameters
Type | Name | Description |
---|---|---|
System.Text.RegularExpressions.Regex | pattern | |
System.String | replacement | |
System.IO.TextReader | in |
Fields
| Improve this Doc View SourceDEFAULT_MAX_BLOCK_CHARS
Declaration
[Obsolete]
public const int DEFAULT_MAX_BLOCK_CHARS = 10000
Field Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceCorrect(Int32)
Declaration
protected override int Correct(int currentOff)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | currentOff |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceRead()
Declaration
public override int Read()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceRead(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 |
Overrides
Implements
System.IDisposable