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

Atomic updates used w/o updateLog should throw an error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0
    • 4.1, 6.0
    • update
    • None

    Description

      The atomic update feature described in SOLR-139 seems to depend on having an <updateLog /> configured in solrconfig.xml.

      When used without an update log, the update commands like set or add don't result in an error and the transaction being aborted, but produce garbled documents instead. This is the case for both the XML and JSON formats for the update message.

      Example:

      I initially created some content like this:

      $ curl 'localhost:8983/solr/update?commit=true' -H 'Content-type:application/json' -d '
      [{"id":"7cb8a43c","Title":"My original Title", "Creator": "John Doe"}]'
      

      Which resulted in this document:

      <doc>
          <str name="id">7cb8a43c</str>
          <str name="Title">My original Title</str>
          <str name="Creator">John Doe</str>
      </doc>
      

      Then I attempted to update that document with this statement:

      $ curl 'localhost:8983/solr/update?commit=true' -H 'Content-type:application/json' -d '
      [{"id":"7cb8a43c","Title":{"set":"My new title"}}]'
      

      Which resulted in this garbled document, with the fields that weren't updated missing:

      <doc>
          <str name="id">7cb8a43c</str>
          <str name="Title">{set=My new title}</str>
      </doc>
      

      Attachments

        1. SOLR-4127.patch
          9 kB
          Chris M. Hostetter

        Issue Links

          Activity

            People

              hossman Chris M. Hostetter
              lukasgraf Lukas Graf
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: