org.apache.solr.update.processor
Class UniqFieldsUpdateProcessorFactory

java.lang.Object
  extended by org.apache.solr.update.processor.UpdateRequestProcessorFactory
      extended by org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
          extended by org.apache.solr.update.processor.FieldValueSubsetUpdateProcessorFactory
              extended by org.apache.solr.update.processor.UniqFieldsUpdateProcessorFactory
All Implemented Interfaces:
NamedListInitializedPlugin, SolrCoreAware

public class UniqFieldsUpdateProcessorFactory
extends FieldValueSubsetUpdateProcessorFactory

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>
 


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
FieldMutatingUpdateProcessorFactory.SelectorParams
 
Nested classes/interfaces inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory
UpdateRequestProcessorFactory.RunAlways
 
Field Summary
static org.slf4j.Logger log
           
 
Constructor Summary
UniqFieldsUpdateProcessorFactory()
           
 
Method Summary
 FieldMutatingUpdateProcessor.FieldNameSelector getDefaultSelector(SolrCore core)
          Defines the default selection behavior when the user has not configured any specific criteria for selecting fields.
 void init(NamedList args)
          Handles common initialization related to source fields for constructing the FieldNameSelector to be used.
 Collection pickSubset(Collection values)
          Method subclasses must override to specify which values should be kept.
 
Methods inherited from class org.apache.solr.update.processor.FieldValueSubsetUpdateProcessorFactory
getInstance
 
Methods inherited from class org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
getBooleanArg, getSelector, inform, oneOrMany, parseSelectorExclusionParams, parseSelectorParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.slf4j.Logger log
Constructor Detail

UniqFieldsUpdateProcessorFactory

public UniqFieldsUpdateProcessorFactory()
Method Detail

getDefaultSelector

public FieldMutatingUpdateProcessor.FieldNameSelector getDefaultSelector(SolrCore core)
Description copied from class: FieldMutatingUpdateProcessorFactory
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.

Overrides:
getDefaultSelector in class FieldMutatingUpdateProcessorFactory
See Also:
FieldMutatingUpdateProcessor.SELECT_ALL_FIELDS

init

public void init(NamedList args)
Description copied from class: FieldMutatingUpdateProcessorFactory
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 interface NamedListInitializedPlugin
Overrides:
init in class FieldMutatingUpdateProcessorFactory

pickSubset

public Collection pickSubset(Collection values)
Description copied from class: FieldValueSubsetUpdateProcessorFactory
Method 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:
pickSubset in class FieldValueSubsetUpdateProcessorFactory


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.