-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 4.0
-
Component/s: contrib - LangId
-
Labels:None
I use LangDetect update processor with a document that has "body" field. LangDetect should map this field to "body_pl", "body_en" or "body_nolang". My schema defines fields with language suffixes, but not "body" field. When the processor runs, I get error:
Unsuccessful field name mapping to body_nolang, field does not exist, skipping mapping.
I looked up source code and it seems there's an error in org.apache.solr.update.processor.LanguageIdentifierUpdateProcessor.process(SolrInputDocument):
String mappedOutputField = getMappedField(fieldName, fieldLang); if(enforceSchema && schema.getFieldOrNull(fieldName) == null) { log.warn("Unsuccessful field name mapping to {}, field does not exist, skipping mapping.", mappedOutputField, fieldName); mappedOutputField = fieldName; }
I think it should check for schema.getFieldOrNull(mappedOutputField) instead.