Package org.apache.solr.update.processor
Class LangDetectLanguageIdentifierUpdateProcessorFactory
java.lang.Object
org.apache.solr.update.processor.UpdateRequestProcessorFactory
org.apache.solr.update.processor.LangDetectLanguageIdentifierUpdateProcessorFactory
- All Implemented Interfaces:
LangIdParams,NamedListInitializedPlugin,SolrCoreAware
public class LangDetectLanguageIdentifierUpdateProcessorFactory
extends UpdateRequestProcessorFactory
implements SolrCoreAware, LangIdParams
Identifies the language of a set of input fields using
http://code.google.com/p/language-detection
The UpdateProcessorChain config entry can take a number of parameters which may also be passed as HTTP parameters on the update request and override the defaults. Here is the simplest processor config possible:
<processor class="org.apache.solr.update.processor.LangDetectLanguageIdentifierUpdateProcessorFactory"> <str name="langid.fl">title,text</str> <str name="langid.langField">language_s</str> </processor>See https://solr.apache.org/guide/solr/latest/indexing-guide/language-detection.html
- Since:
- 3.5
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory
UpdateRequestProcessorFactory.RunAlways -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.solr.common.params.SolrParamsprotected org.apache.solr.common.params.SolrParamsprotected org.apache.solr.common.params.SolrParamsFields inherited from interface org.apache.solr.update.processor.LangIdParams
DOCID_FIELD_DEFAULT, DOCID_LANGFIELD_DEFAULT, DOCID_LANGSFIELD_DEFAULT, DOCID_PARAM, DOCID_THRESHOLD_DEFAULT, ENFORCE_SCHEMA, FALLBACK, FALLBACK_FIELDS, FIELDS_PARAM, LANG_ALLOWLIST, LANG_FIELD, LANGS_FIELD, LANGUAGE_ID, LCMAP, MAP_ENABLE, MAP_FL, MAP_INDIVIDUAL, MAP_INDIVIDUAL_FL, MAP_KEEP_ORIG, MAP_LCMAP, MAP_OVERWRITE, MAP_PATTERN, MAP_PATTERN_DEFAULT, MAP_REPLACE, MAP_REPLACE_DEFAULT, MAX_FIELD_VALUE_CHARS, MAX_FIELD_VALUE_CHARS_DEFAULT, MAX_TOTAL_CHARS, MAX_TOTAL_CHARS_DEFAULT, OVERWRITE, THRESHOLD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) voidvoidinit(org.apache.solr.common.util.NamedList<?> args) The UpdateRequestProcessor may be initialized in solrconfig.xml similarly to a RequestHandler, with defaults, appends and invariants.static voidloadData()
-
Field Details
-
defaults
protected org.apache.solr.common.params.SolrParams defaults -
appends
protected org.apache.solr.common.params.SolrParams appends -
invariants
protected org.apache.solr.common.params.SolrParams invariants
-
-
Constructor Details
-
LangDetectLanguageIdentifierUpdateProcessorFactory
public LangDetectLanguageIdentifierUpdateProcessorFactory()
-
-
Method Details
-
inform
- Specified by:
informin interfaceSolrCoreAware
-
init
public void init(org.apache.solr.common.util.NamedList<?> args) The UpdateRequestProcessor may be initialized in solrconfig.xml similarly to a RequestHandler, with defaults, appends and invariants.- Specified by:
initin interfaceNamedListInitializedPlugin- Parameters:
args- a NamedList with the configuration parameters
-
getInstance
public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) - Specified by:
getInstancein classUpdateRequestProcessorFactory
-
loadData
- Throws:
IOExceptioncom.cybozu.labs.langdetect.LangDetectException
-