public final class RegexReplaceProcessorFactory extends FieldMutatingUpdateProcessorFactory
By default this processor applies itself to no fields.
By default, literalReplacement is set to true, in which
case, the replacement string will be treated literally by
quoting via Matcher.quoteReplacement(String). And hence, '\'
and '$' signs will not be processed. When literalReplacement
is set to false, one can perform backreference operations and capture
group substitutions.
For example, with the configuration listed below, any sequence of multiple
whitespace characters found in values for field named title
or content will be replaced by a single space character.
<processor class="solr.RegexReplaceProcessorFactory"> <str name="fieldName">content</str> <str name="fieldName">title</str> <str name="pattern">\s+</str> <str name="replacement"> </str> <bool name="literalReplacement">true</bool> </processor>
PatternFieldMutatingUpdateProcessorFactory.SelectorParamsUpdateRequestProcessorFactory.RunAlways| Constructor and Description |
|---|
RegexReplaceProcessorFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected FieldMutatingUpdateProcessor.FieldNameSelector |
getDefaultSelector(SolrCore core)
Defines the default selection behavior when the user has not
configured any specific criteria for selecting fields.
|
UpdateRequestProcessor |
getInstance(SolrQueryRequest request,
SolrQueryResponse response,
UpdateRequestProcessor next) |
void |
init(NamedList args)
Handles common initialization related to source fields for
constructing the FieldNameSelector to be used.
|
getBooleanArg, getSelector, inform, oneOrMany, parseSelectorExclusionParams, parseSelectorParamspublic void init(NamedList args)
FieldMutatingUpdateProcessorFactoryinit in interface NamedListInitializedPlugininit in class FieldMutatingUpdateProcessorFactoryprotected FieldMutatingUpdateProcessor.FieldNameSelector getDefaultSelector(SolrCore core)
FieldMutatingUpdateProcessorFactorygetDefaultSelector in class FieldMutatingUpdateProcessorFactoryFieldMutatingUpdateProcessor.SELECT_NO_FIELDSpublic UpdateRequestProcessor getInstance(SolrQueryRequest request, SolrQueryResponse response, UpdateRequestProcessor next)
getInstance in class UpdateRequestProcessorFactoryCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.