This filter uses regular expressions to replace or change character patterns.
Arguments:
- pattern: The regular expression pattern to apply to the incoming text
- replacement: The text to use to replace matching patterns
Example:
<fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<charFilter class="solr.PatternReplaceCharFilterFactory" pattern="(w+)(ing)" replacement="$1"/>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
</analyzer>
</fieldType>
Input: showing see-ing viewing
Output: show, see-ing, view
As per the behavior of the pattern, ing is removed from the end of the words except see-ing.
Explaining every char filter is not possible here. Please refer to the Solr documents for these.