Package org.apache.solr.update.processor
Class DefaultValueUpdateProcessorFactory
java.lang.Object
org.apache.solr.update.processor.UpdateRequestProcessorFactory
org.apache.solr.update.processor.AbstractDefaultValueUpdateProcessorFactory
org.apache.solr.update.processor.DefaultValueUpdateProcessorFactory
- All Implemented Interfaces:
NamedListInitializedPlugin
An update processor that adds a constant default value to any document being added that does not
already have a value in the specified field.
In the example configuration below, if a document does not contain a value in the price
and/or type fields, it will be given default values of 0.0
and/or unknown (respectively).
<processor class="solr.DefaultValueUpdateProcessorFactory"> <str name="fieldName">price</str> <float name="value">0.0</float> </processor> <processor class="solr.DefaultValueUpdateProcessorFactory"> <str name="fieldName">type</str> <str name="value">unknown</str> </processor>
- Since:
- 4.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory
UpdateRequestProcessorFactory.RunAlways -
Field Summary
FieldsFields inherited from class org.apache.solr.update.processor.AbstractDefaultValueUpdateProcessorFactory
fieldName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) voidinit(org.apache.solr.common.util.NamedList<?> args) initwill be called just once, immediately after creation.
-
Field Details
-
defaultValue
-
-
Constructor Details
-
DefaultValueUpdateProcessorFactory
public DefaultValueUpdateProcessorFactory()
-
-
Method Details
-
init
public void init(org.apache.solr.common.util.NamedList<?> args) Description copied from interface:NamedListInitializedPlugininitwill be called just once, immediately after creation.Source of the initialization arguments will typically be solrconfig.xml, but will ultimately depends on the plugin itself
- Specified by:
initin interfaceNamedListInitializedPlugin- Overrides:
initin classAbstractDefaultValueUpdateProcessorFactory- Parameters:
args- non-null list of initialization parameters (may be empty)
-
getInstance
public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) - Specified by:
getInstancein classUpdateRequestProcessorFactory
-