Class FieldMutatingUpdateProcessorFactory
- java.lang.Object
-
- org.apache.solr.update.processor.UpdateRequestProcessorFactory
-
- org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
-
- All Implemented Interfaces:
NamedListInitializedPlugin
,SolrCoreAware
- Direct Known Subclasses:
ConcatFieldUpdateProcessorFactory
,CountFieldValuesUpdateProcessorFactory
,FieldLengthUpdateProcessorFactory
,FieldValueSubsetUpdateProcessorFactory
,HTMLStripFieldUpdateProcessorFactory
,IgnoreFieldUpdateProcessorFactory
,ParseBooleanFieldUpdateProcessorFactory
,ParseDateFieldUpdateProcessorFactory
,ParseNumericFieldUpdateProcessorFactory
,PreAnalyzedUpdateProcessorFactory
,RegexReplaceProcessorFactory
,RemoveBlankFieldUpdateProcessorFactory
,TrimFieldUpdateProcessorFactory
,TruncateFieldUpdateProcessorFactory
public abstract class FieldMutatingUpdateProcessorFactory extends UpdateRequestProcessorFactory implements SolrCoreAware
Base class for implementing Factories for FieldMutatingUpdateProcessors and FieldValueMutatingUpdateProcessors.This class provides all of the plumbing for configuring the FieldNameSelector using the following init params to specify selection criteria...
fieldName
- selecting specific fields by field name lookupfieldRegex
- selecting specific fields by field name regex match (regexes are checked in the order specified)typeName
- selecting specific fields by fieldType name lookuptypeClass
- selecting specific fields by fieldType class lookup, including inheritence and interfaces
Each criteria can specified as either an <arr> of <str>, or multiple <str> with the same name. When multiple criteria of a single type exist, fields must match at least one to be selected. If more then one type of criteria exist, fields must match at least one of each to be selected.
The following additional selector may be specified as a <bool> - when specified as false, only fields that do not match a schema field/dynamic field are selected; when specified as true, only fields that do match a schema field/dynamic field are selected:
fieldNameMatchesSchemaField
- selecting specific fields based on whether or not they match a schema field
One or more
excludes
<lst> params may also be specified, containing any of the above criteria, identifying fields to be excluded from seelction even if they match the selection criteria. As with the main selection critiera a field must match all of criteria in a single exclusion in order to be excluded, but multiple exclusions may be specified to get anOR
behaviorIn the ExampleFieldMutatingUpdateProcessorFactory configured below, fields will be mutated if the name starts with "foo" or "bar"; unless the field name contains the substring "SKIP" or the fieldType is (or subclasses) DatePointField. Meaning a field named "foo_SKIP" is guaranteed not to be selected, but a field named "bar_smith" that uses StrField will be selected.
<processor class="solr.ExampleFieldMutatingUpdateProcessorFactory"> <str name="fieldRegex">foo.*</str> <str name="fieldRegex">bar.*</str> <!-- each set of exclusions is checked independently --> <lst name="exclude"> <str name="fieldRegex">.*SKIP.*</str> </lst> <lst name="exclude"> <str name="typeClass">solr.DatePointField</str> </lst> </processor>
Subclasses define the default selection behavior to be applied if no criteria is configured by the user. User configured "exclude" criteria will be applied to the subclass defined default selector.
- Since:
- 4.0.0
- See Also:
FieldMutatingUpdateProcessor
,FieldValueMutatingUpdateProcessor
,FieldMutatingUpdateProcessor.FieldNameSelector
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FieldMutatingUpdateProcessorFactory.SelectorParams
-
Nested classes/interfaces inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory
UpdateRequestProcessorFactory.RunAlways
-
-
Constructor Summary
Constructors Constructor Description FieldMutatingUpdateProcessorFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FieldMutatingUpdateProcessor.FieldNameSelector
getDefaultSelector(SolrCore core)
Defines the default selection behavior when the user has not configured any specific criteria for selecting fields.protected FieldMutatingUpdateProcessor.FieldNameSelector
getSelector()
void
inform(SolrCore core)
void
init(org.apache.solr.common.util.NamedList<?> args)
Handles common initialization related to source fields for constructing the FieldNameSelector to be used.static Collection<FieldMutatingUpdateProcessorFactory.SelectorParams>
parseSelectorExclusionParams(org.apache.solr.common.util.NamedList<?> args)
static FieldMutatingUpdateProcessorFactory.SelectorParams
parseSelectorParams(org.apache.solr.common.util.NamedList<?> args)
-
Methods inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory
getInstance
-
-
-
-
Method Detail
-
getSelector
protected final FieldMutatingUpdateProcessor.FieldNameSelector getSelector()
-
parseSelectorParams
public static FieldMutatingUpdateProcessorFactory.SelectorParams parseSelectorParams(org.apache.solr.common.util.NamedList<?> args)
-
parseSelectorExclusionParams
public static Collection<FieldMutatingUpdateProcessorFactory.SelectorParams> parseSelectorExclusionParams(org.apache.solr.common.util.NamedList<?> args)
-
init
public void init(org.apache.solr.common.util.NamedList<?> args)
Handles common initialization related to source fields for constructing the FieldNameSelector to be used.Will error if any unexpected init args are found, so subclasses should remove any subclass-specific init args before calling this method.
- Specified by:
init
in interfaceNamedListInitializedPlugin
- Parameters:
args
- non-null list of initialization parameters (may be empty)
-
inform
public void inform(SolrCore core)
- Specified by:
inform
in interfaceSolrCoreAware
-
getDefaultSelector
protected FieldMutatingUpdateProcessor.FieldNameSelector getDefaultSelector(SolrCore core)
Defines the default selection behavior when the user has not configured any specific criteria for selecting fields. The Default implementation matches all fields, and should be overridden by subclasses as needed.
-
-