Package org.apache.solr.update.processor
Class FieldLengthUpdateProcessorFactory
java.lang.Object
org.apache.solr.update.processor.UpdateRequestProcessorFactory
org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
org.apache.solr.update.processor.FieldLengthUpdateProcessorFactory
- All Implemented Interfaces:
NamedListInitializedPlugin,SolrCoreAware
Replaces any CharSequence values found in fields matching the specified conditions with the
lengths of those CharSequences (as an Integer).
By default, this processor matches no fields.
For example, with the configuration listed below any documents containing String values (such
as "abcdef" or "xyz") in a field declared in the schema using
IntPointField or LongPointField would have those Strings replaced with the
length of those fields as an Integer (ie: 6 and 3 respectively)
<processor class="solr.FieldLengthUpdateProcessorFactory">
<arr name="typeClass">
<str>solr.IntPointField</str>
<str>solr.LongPointField</str>
</arr>
</processor>- Since:
- 4.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
FieldMutatingUpdateProcessorFactory.SelectorParamsNested classes/interfaces inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory
UpdateRequestProcessorFactory.RunAlways -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDefaultSelector(SolrCore core) Defines the default selection behavior when the user has not configured any specific criteria for selecting fields.getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) voidinit(org.apache.solr.common.util.NamedList<?> args) Handles common initialization related to source fields for constructing the FieldNameSelector to be used.Methods inherited from class org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
getSelector, inform, parseSelectorExclusionParams, parseSelectorParams
-
Constructor Details
-
FieldLengthUpdateProcessorFactory
public FieldLengthUpdateProcessorFactory()
-
-
Method Details
-
init
public void init(org.apache.solr.common.util.NamedList<?> args) Description copied from class:FieldMutatingUpdateProcessorFactoryHandles 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:
initin interfaceNamedListInitializedPlugin- Overrides:
initin classFieldMutatingUpdateProcessorFactory- Parameters:
args- non-null list of initialization parameters (may be empty)
-
getDefaultSelector
Description copied from class:FieldMutatingUpdateProcessorFactoryDefines 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.- Overrides:
getDefaultSelectorin classFieldMutatingUpdateProcessorFactory- See Also:
-
getInstance
public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) - Specified by:
getInstancein classUpdateRequestProcessorFactory
-