Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-3967

Mapping error: langid.enforceSchema option checks source field instead of target field

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0
    • 4.2, 6.0
    • contrib - LangId
    • None

    Description

      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.

      Attachments

        1. SOLR-3967.patch
          5 kB
          Jan Høydahl

        Activity

          People

            janhoy Jan Høydahl
            mmatela Mateusz Matela
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: