org.apache.solr.update.processor

Class FirstFieldValueUpdateProcessorFactory

  • All Implemented Interfaces:
    NamedListInitializedPlugin, SolrCoreAware


    public final class FirstFieldValueUpdateProcessorFactory
    extends FieldValueSubsetUpdateProcessorFactory
    Keeps only the first 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 first value (ie: "Adam Doe") will be kept

     <processor class="solr.FirstFieldValueUpdateProcessorFactory">
       <str name="fieldName">primary_author</str>
     </processor>
     
    See Also:
    LastFieldValueUpdateProcessorFactory