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, 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 lookup
  • fieldRegex - selecting specific fields by field name regex match (regexes are checked in the order specified)
  • typeName - selecting specific fields by fieldType name lookup
  • typeClass - 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 an OR behavior

In 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: