Class DocumentCategorizerUpdateProcessorFactory
- All Implemented Interfaces:
NamedListInitializedPlugin,SolrCoreAware
modelFile from the values found
in any matching source field into a configured dest field.
See the Tutorial for the step by step guide.
The source field(s) can be configured as either:
- One or more
<str> - An
<arr>of<str> - A
<lst>containingFieldMutatingUpdateProcessorFactory style selector arguments
The dest field can be a single <str> containing the literal
name of a destination field, or it may be a <lst> specifying a regex
pattern and a replacement string. If the pattern + replacement option is used
the pattern will be matched against all fields matched by the source selector, and the
replacement string (including any capture groups specified from the pattern) will be evaluated a
using Matcher.replaceAll(String) to generate the literal name of the destination field.
If the resolved dest field already exists in the document, then the named
entities extracted from the source fields will be added to it.
In the example below:
- Classification will be performed on the
textfield and added to thetext_sentimentfield
<updateRequestProcessorChain name="sentimentClassifier">
<processor class="solr.processor.DocumentCategorizerUpdateProcessorFactory">
<str name="modelFile">models/sentiment/model.onnx</str>
<str name="vocabFile">models/sentiment/vocab.txt</str>
<str name="source">text</str>
<str name="dest">text_sentiment</str>
</processor>
<processor class="solr.LogUpdateProcessorFactory" />
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
- Since:
- 10.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory
UpdateRequestProcessorFactory.RunAlways -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal UpdateRequestProcessorgetInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) protected final FieldMutatingUpdateProcessor.FieldNameSelectorvoidvoidinit(org.apache.solr.common.util.NamedList<?> args)
-
Field Details
-
SOURCE_PARAM
- See Also:
-
DEST_PARAM
- See Also:
-
PATTERN_PARAM
- See Also:
-
REPLACEMENT_PARAM
- See Also:
-
MODEL_PARAM
- See Also:
-
VOCAB_PARAM
- See Also:
-
-
Constructor Details
-
DocumentCategorizerUpdateProcessorFactory
public DocumentCategorizerUpdateProcessorFactory()
-
-
Method Details
-
getSourceSelector
-
init
public void init(org.apache.solr.common.util.NamedList<?> args) - Specified by:
initin interfaceNamedListInitializedPlugin
-
inform
- Specified by:
informin interfaceSolrCoreAware
-
getInstance
public final UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) - Specified by:
getInstancein classUpdateRequestProcessorFactory
-