org.apache.solr.update.processor
Class LastFieldValueUpdateProcessorFactory

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.LastFieldValueUpdateProcessorFactory
All Implemented Interfaces:
NamedListInitializedPlugin, SolrCoreAware

public final class LastFieldValueUpdateProcessorFactory
extends FieldValueSubsetUpdateProcessorFactory

Keeps only the last value of fields matching the specified conditions. Correct behavior assumes that the SolrInputFields being mutated are either single valued, or use an ordered Collection (ie: not a Set).

By default, this processor matches no fields.

For example, in the configuration below, if a field named primary_author contained multiple values (ie: "Adam Doe", "Bob Smith", "Carla Jones") then only the last value (ie: "Carla Jones") will be kept

 <processor class="solr.LastFieldValueUpdateProcessorFactory">
   <str name="fieldName">primary_author</str>
 </processor>
 

See Also:
FirstFieldValueUpdateProcessorFactory

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
 
Constructor Summary
LastFieldValueUpdateProcessorFactory()
           
 
Method Summary
 FieldMutatingUpdateProcessor.FieldNameSelector getDefaultSelector(SolrCore core)
          Defines the default selection behavior when the user has not configured any specific criteria for selecting fields.
 Collection<Object> pickSubset(Collection<Object> 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, init, oneOrMany, parseSelectorExclusionParams, parseSelectorParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LastFieldValueUpdateProcessorFactory

public LastFieldValueUpdateProcessorFactory()
Method Detail

pickSubset

public Collection<Object> pickSubset(Collection<Object> 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

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


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