public abstract class FieldMutatingUpdateProcessorFactory extends UpdateRequestProcessorFactory implements SolrCoreAware
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 interfacesEach 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) DateField. 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.DateField</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.
Modifier and Type | Class and Description |
---|---|
static class |
FieldMutatingUpdateProcessorFactory.SelectorParams |
UpdateRequestProcessorFactory.RunAlways
Constructor and Description |
---|
FieldMutatingUpdateProcessorFactory() |
Modifier and Type | Method and Description |
---|---|
static Boolean |
getBooleanArg(NamedList args,
String key)
Deprecated.
Use
NamedList.removeBooleanArg(java.lang.String) instead. Will be
removed in 5.0. |
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(NamedList args)
Handles common initialization related to source fields for
constructing the FieldNameSelector to be used.
|
static Collection<String> |
oneOrMany(NamedList args,
String key)
Deprecated.
Replaced by
NamedList.removeConfigArgs(String) . Will be
removed in version 5.0. |
static Collection<FieldMutatingUpdateProcessorFactory.SelectorParams> |
parseSelectorExclusionParams(NamedList args) |
static FieldMutatingUpdateProcessorFactory.SelectorParams |
parseSelectorParams(NamedList args) |
getInstance
protected final FieldMutatingUpdateProcessor.FieldNameSelector getSelector()
public static FieldMutatingUpdateProcessorFactory.SelectorParams parseSelectorParams(NamedList args)
public static Collection<FieldMutatingUpdateProcessorFactory.SelectorParams> parseSelectorExclusionParams(NamedList args)
public void init(NamedList args)
init
in interface NamedListInitializedPlugin
init
in class UpdateRequestProcessorFactory
public void inform(SolrCore core)
inform
in interface SolrCoreAware
protected FieldMutatingUpdateProcessor.FieldNameSelector getDefaultSelector(SolrCore core)
@Deprecated public static Collection<String> oneOrMany(NamedList args, String key)
NamedList.removeConfigArgs(String)
. Will be
removed in version 5.0.SolrException
- invalid arr/str structure.@Deprecated public static Boolean getBooleanArg(NamedList args, String key)
NamedList.removeBooleanArg(java.lang.String)
instead. Will be
removed in 5.0.SolrException
- invalid type or structureCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.