public abstract class FieldMutatingUpdateProcessor extends UpdateRequestProcessor
Subclasses should override the mutate method to specify how individual SolrInputFields identified by the selector associated with this instance will be mutated.
Modifier and Type | Class and Description |
---|---|
static interface |
FieldMutatingUpdateProcessor.FieldNameSelector
Interface for identifying which fields should be mutated
|
Modifier and Type | Field and Description |
---|---|
static FieldMutatingUpdateProcessor.FieldNameSelector |
SELECT_ALL_FIELDS
Singleton indicating all fields should be mutated
|
static FieldMutatingUpdateProcessor.FieldNameSelector |
SELECT_NO_FIELDS
Singleton indicating no fields should be mutated
|
next
Constructor and Description |
---|
FieldMutatingUpdateProcessor(FieldMutatingUpdateProcessor.FieldNameSelector selector,
UpdateRequestProcessor next) |
Modifier and Type | Method and Description |
---|---|
static FieldMutatingUpdateProcessor.FieldNameSelector |
createFieldNameSelector(SolrResourceLoader loader,
IndexSchema schema,
FieldMutatingUpdateProcessorFactory.SelectorParams params,
FieldMutatingUpdateProcessor.FieldNameSelector defSelector)
Utility method that can be used to define a FieldNameSelector
using the same types of rules as the FieldMutatingUpdateProcessor init
code.
|
static FieldMutatingUpdateProcessor.FieldNameSelector |
createFieldNameSelector(SolrResourceLoader loader,
SolrCore core,
FieldMutatingUpdateProcessorFactory.SelectorParams params,
FieldMutatingUpdateProcessor.FieldNameSelector defSelector)
Utility method that can be used to define a FieldNameSelector
using the same types of rules as the FieldMutatingUpdateProcessor init
code.
|
protected abstract SolrInputField |
mutate(SolrInputField src)
Method for mutating SolrInputFields associated with fields identified
by the FieldNameSelector associated with this processor
|
static FieldMutatingUpdateProcessor |
mutator(FieldMutatingUpdateProcessor.FieldNameSelector selector,
UpdateRequestProcessor next,
Function<SolrInputField,SolrInputField> fun) |
void |
processAdd(AddUpdateCommand cmd)
Calls
mutate on any fields identified by the selector
before forwarding the command down the chain. |
static FieldMutatingUpdateProcessor.FieldNameSelector |
wrap(FieldMutatingUpdateProcessor.FieldNameSelector includes,
FieldMutatingUpdateProcessor.FieldNameSelector excludes)
Wraps two FieldNameSelectors such that the FieldNameSelector
returned matches all fields specified by the "includes" unless they
are matched by "excludes"
|
close, doClose, finish, processCommit, processDelete, processMergeIndexes, processRollback
public static final FieldMutatingUpdateProcessor.FieldNameSelector SELECT_ALL_FIELDS
public static final FieldMutatingUpdateProcessor.FieldNameSelector SELECT_NO_FIELDS
public FieldMutatingUpdateProcessor(FieldMutatingUpdateProcessor.FieldNameSelector selector, UpdateRequestProcessor next)
protected abstract SolrInputField mutate(SolrInputField src)
src
- the SolrInputField to mutate, may be modified in place and
returnedpublic void processAdd(AddUpdateCommand cmd) throws IOException
mutate
on any fields identified by the selector
before forwarding the command down the chain. Any SolrExceptions
thrown by mutate
will be logged with the Field name,
wrapped and re-thrown.processAdd
in class UpdateRequestProcessor
IOException
public static FieldMutatingUpdateProcessor.FieldNameSelector wrap(FieldMutatingUpdateProcessor.FieldNameSelector includes, FieldMutatingUpdateProcessor.FieldNameSelector excludes)
includes
- a selector identifying field names that should be selectedexcludes
- a selector identifying field names that should be
not be selected, even if they are matched by the 'includes'
selectorpublic static FieldMutatingUpdateProcessor.FieldNameSelector createFieldNameSelector(SolrResourceLoader loader, SolrCore core, FieldMutatingUpdateProcessorFactory.SelectorParams params, FieldMutatingUpdateProcessor.FieldNameSelector defSelector)
public static FieldMutatingUpdateProcessor.FieldNameSelector createFieldNameSelector(SolrResourceLoader loader, IndexSchema schema, FieldMutatingUpdateProcessorFactory.SelectorParams params, FieldMutatingUpdateProcessor.FieldNameSelector defSelector)
schema
for checking field existence.public static FieldMutatingUpdateProcessor mutator(FieldMutatingUpdateProcessor.FieldNameSelector selector, UpdateRequestProcessor next, Function<SolrInputField,SolrInputField> fun)
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.