org.apache.solr.update.processor
Class TrimFieldUpdateProcessorFactory

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

public final class TrimFieldUpdateProcessorFactory
extends FieldMutatingUpdateProcessorFactory

Trims leading and trailing whitespace from any CharSequence values found in fields matching the specified conditions and returns the resulting String.

By default this processor matches all fields

For example, with the configuration listed all String field values will have leading and trailing spaces removed except for fields whose named ends with "_literal".

 <processor class="solr.TrimFieldUpdateProcessorFactory">
   <lst name="exclude">
     <str name="fieldRegex">.*_literal</str>
   </lst>
 </processor>


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
FieldMutatingUpdateProcessorFactory.SelectorParams
 
Constructor Summary
TrimFieldUpdateProcessorFactory()
           
 
Method Summary
 UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)
           
 void init(NamedList args)
          Handles common initialization related to source fields for constructoring the FieldNameSelector to be used.
 
Methods inherited from class org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
getDefaultSelector, getSelector, inform, oneOrMany, parseSelectorParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrimFieldUpdateProcessorFactory

public TrimFieldUpdateProcessorFactory()
Method Detail

init

public void init(NamedList args)
Description copied from class: FieldMutatingUpdateProcessorFactory
Handles common initialization related to source fields for constructoring 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

getInstance

public UpdateRequestProcessor getInstance(SolrQueryRequest req,
                                          SolrQueryResponse rsp,
                                          UpdateRequestProcessor next)
Specified by:
getInstance in class UpdateRequestProcessorFactory


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