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

Atomic update deletes child documents if schema has catch-all ignore field

    XMLWordPrintableJSON

Details

    Description

      Nested child documents disappear when some unrelated fields of a parent document are atomically updated, if the schema contains a catch-all dynamic field to ignore unknown fields like:

      <dynamicField name="*" type="ignored" />
      <fieldType name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" /> 

      DistributedUpdateProcessor#getUpdatedDocument tries to reconstruct the original document, but it does not receive nested documents from RealTimeComponent#getInputDocument. Nested documents are correctly found in the index but get lost when RealTimeGetComponent#toSolrInputDocument creates a SolrInputDocument for it. The problematic code is:

      SchemaField sf = schema.getFieldOrNull(fname);
      if (sf != null) {
        if ((!sf.hasDocValues() && !sf.stored()) || schema.isCopyFieldTarget(sf)) continue;
      } 

      The code finds the "ignored" SchemaField as matching field for the nested document name (loaded from nest_path). Because of that they're not added to the SolrInputDocument.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ahubold Andreas Hubold
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: