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

DIH: fields added by update processors to $deleteDocById documents trigger warnings

    XMLWordPrintableJSON

Details

    Description

      Hello,

      We are processing XML data with the DIH. Deleted documents are also coming in with XML. Hence the data-config.xml below.

      <dataConfig>
        <dataSource type="FileDataSource" encoding="UTF-8"/>
        <document>
          <entity
                  name="fileListDelete" processor="FileListEntityProcessor"
                  baseDir="/path/to/dir" recursive="true"
                  fileName="delete.xml" rootEntity="false">
      
            <entity
                    name="xmlFileDelete" processor="XPathEntityProcessor"
                    url="${fileListDelete.fileAbsolutePath}" stream="true"
                    forEach="Docs/Doc">
      
              <field column="$deleteDocById" xpath="/Docs/Doc"/>
            </entity>
          </entity>
        </document>
      </dataConfig>
      

       

      We also configured an DefaultValueUpdateProcessor to add an update timestamp to all documents.

      <!-- solrconfig.xml -->
      <updateRequestProcessorChain name="default-chain">
        <.../>
      
        <!-- set update timestamp -->
        <processor class="solr.DefaultValueUpdateProcessorFactory">
          <str name="fieldName">update_timestamp</str>
          <str name="value">NOW</str>
        </processor>
      
        <processor class="solr.DistributedUpdateProcessorFactory"/>
      
        <.../>
      </updateRequestProcessorChain>
      

       

      Even though the document is marked to be deleted, the update processor adds the timestamp field, which triggers the warning below.

      2019-11-22 18:28:19.241 WARN  (qtp436532993-17) [   x:core] o.a.s.h.d.SolrWriter Error creating document : SolrInputDocument(fields: [update_timestamp=NOW])
      org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id
      

       

      However, the documents is deleted properly.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              toshokanin Marco Remy
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: