org.apache.solr.update.processor
Class ConcatFieldUpdateProcessorFactory
java.lang.Object
org.apache.solr.update.processor.UpdateRequestProcessorFactory
org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
org.apache.solr.update.processor.ConcatFieldUpdateProcessorFactory
- All Implemented Interfaces:
- NamedListInitializedPlugin, SolrCoreAware
public final class ConcatFieldUpdateProcessorFactory
- extends FieldMutatingUpdateProcessorFactory
Concatenates multiple values for fields matching the specified
conditions using a configurable delimiter
which defaults
to ",
".
By default, this processor concatenates the values for any field name
which according to the schema is multiValued="false"
and uses TextField
or StrField
For example, in the configuration below, any "single valued" string and
text field which is found to contain multiple values except for
the primary_author
field will be concatenated using the
string ";
" as a delimeter. For the
primary_author
field, the multiple values will be left
alone for FirstFieldValueUpdateProcessorFactory
to deal with.
<processor class="solr.ConcatFieldUpdateProcessorFactory">
<str name="delimiter">; </str>
<lst name="exclude">
<str name="fieldName">primary_author</str>
</lst>
</processor>
<processor class="solr.FirstFieldValueUpdateProcessorFactory">
<str name="fieldName">primary_author</str>
</processor>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConcatFieldUpdateProcessorFactory
public ConcatFieldUpdateProcessorFactory()
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
getInstance
public UpdateRequestProcessor getInstance(SolrQueryRequest req,
SolrQueryResponse rsp,
UpdateRequestProcessor next)
- Specified by:
getInstance
in class UpdateRequestProcessorFactory
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.