public class CloneFieldUpdateProcessorFactory extends UpdateRequestProcessorFactory implements SolrCoreAware
source
field into
the configured dest
field.
While the dest
field must be a single <str>
,
the source
fields can be configured as either:
<str>
<arr>
of <str>
<lst>
containing FieldMutatingUpdateProcessorFactory style selector arguments
If the dest
field already exists in the document, then the
values from the source
fields will be added to it. The
"boost" value associated with the dest
will not be changed,
and any boost specified on the source
fields will be ignored.
(If the dest
field did not exist prior to this processor, the
newly created dest
field will have the default boost of 1.0)
In the example below, the category
field will be cloned
into the category_s
field, both the authors
and
editors
fields will be cloned into the contributors
field, and any field with a name ending in _price
-- except for
list_price
-- will be cloned into the all_prices
field.
<updateRequestProcessorChain name="multiple-clones"> <processor class="solr.CloneFieldUpdateProcessorFactory"> <str name="source">category</str> <str name="dest">category_s</str> </processor> <processor class="solr.CloneFieldUpdateProcessorFactory"> <arr name="source"> <str>authors</str> <str>editors</str> </arr> <str name="dest">contributors</str> </processor> <processor class="solr.CloneFieldUpdateProcessorFactory"> <lst name="source"> <str name="fieldRegex">.*_price</str> <lst name="exclude"> <str name="fieldName">list_price</str> </lst> </lst> <str name="dest">all_prices</str> </processor> </updateRequestProcessorChain>
UpdateRequestProcessorFactory.RunAlways
Modifier and Type | Field and Description |
---|---|
static String |
DEST_PARAM |
static String |
SOURCE_PARAM |
Constructor and Description |
---|
CloneFieldUpdateProcessorFactory() |
Modifier and Type | Method and Description |
---|---|
UpdateRequestProcessor |
getInstance(SolrQueryRequest req,
SolrQueryResponse rsp,
UpdateRequestProcessor next) |
protected FieldMutatingUpdateProcessor.FieldNameSelector |
getSourceSelector() |
void |
inform(SolrCore core) |
void |
init(NamedList args) |
public static final String SOURCE_PARAM
public static final String DEST_PARAM
protected final FieldMutatingUpdateProcessor.FieldNameSelector getSourceSelector()
public void init(NamedList args)
init
in interface NamedListInitializedPlugin
init
in class UpdateRequestProcessorFactory
public void inform(SolrCore core)
inform
in interface SolrCoreAware
public final UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)
getInstance
in class UpdateRequestProcessorFactory
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.