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>
Pattern
FieldMutatingUpdateProcessorFactory.SelectorParams
UpdateRequestProcessorFactory.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, parseSelectorParams
public void init(NamedList args)
FieldMutatingUpdateProcessorFactory
init
in interface NamedListInitializedPlugin
init
in class FieldMutatingUpdateProcessorFactory
protected FieldMutatingUpdateProcessor.FieldNameSelector getDefaultSelector(SolrCore core)
FieldMutatingUpdateProcessorFactory
getDefaultSelector
in class FieldMutatingUpdateProcessorFactory
FieldMutatingUpdateProcessor.SELECT_NO_FIELDS
public UpdateRequestProcessor getInstance(SolrQueryRequest request, SolrQueryResponse response, UpdateRequestProcessor next)
getInstance
in class UpdateRequestProcessorFactory
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.