Package org.apache.solr.update.processor
Class UniqFieldsUpdateProcessorFactory
java.lang.Object
org.apache.solr.update.processor.UpdateRequestProcessorFactory
org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
org.apache.solr.update.processor.FieldValueSubsetUpdateProcessorFactory
org.apache.solr.update.processor.UniqFieldsUpdateProcessorFactory
- All Implemented Interfaces:
NamedListInitializedPlugin,SolrCoreAware
Removes duplicate values found in fields matching the specified conditions. The existing field
values are iterated in order, and values are removed when they are equal to a value that has
already been seen for this field.
By default this processor matches no fields.
In the example configuration below, if a document initially contains the values
"Steve","Lucy","Jim",Steve","Alice","Bob","Alice" in a field named foo_uniq
then using this processor will result in the final list of field values being
"Steve","Lucy","Jim","Alice","Bob"
<processor class="solr.UniqFieldsUpdateProcessorFactory">
<str name="fieldRegex">.*_uniq</str>
</processor>
- Since:
- 3.4.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.<T> Collection<T> pickSubset(Collection<T> values) Method subclasses must override to specify which values should be kept.Methods inherited from class org.apache.solr.update.processor.FieldValueSubsetUpdateProcessorFactory
getInstanceMethods inherited from class org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
getSelector, inform, init, parseSelectorExclusionParams, parseSelectorParams
-
Constructor Details
-
UniqFieldsUpdateProcessorFactory
public UniqFieldsUpdateProcessorFactory()
-
-
Method Details
-
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:
-
pickSubset
Description copied from class:FieldValueSubsetUpdateProcessorFactoryMethod subclasses must override to specify which values should be kept. This method will not be called unless the collection contains more then one value.- Specified by:
pickSubsetin classFieldValueSubsetUpdateProcessorFactory
-