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

Solr 4 atomic update incorrect value when setting two or more values to a multivalue via XML update

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Duplicate
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0.1, 4.1
    • Component/s: clients - java, update
    • Labels:
      None
    • Environment:

      RHEL

      Description

      Setting multiple values to a multivalued field via an XML atomic update request is resulting in what appears to be the output of a toString() method. See the examples below.

      I ran into this issue using the output for atomic updates from the fix for Solr-4133 to ClientUtils. The server being used is the base 4.0.0 release.

      curl 'https://localhost/solr/update?commit=true' -H 'Content-type:text/xml' -d '
      <add><doc boost="1.0">
      <field name="id">test</field>
      <field name="status" update="set">one</field>
      <field name="status" update="set">two</field>
      </doc></add>'
      

      Yields the following in Solr:

        <arr name="status"><str>{set=one}</str><str>{set=two}</str></arr>
      

      Changing the second "set" to an "add" has the same effect.

      If I only set one value though, it works correctly:

      <add><doc boost="1.0">
      <field name="id">test</field>
      <field name="status" update="set">one</field>
      </doc></add>
      

      Yields:

      <arr name="status"><str>one</str></arr>
      

      It also works fine if I split it into two operations

      <add><doc boost="1.0">
      <field name="id">test</field>
      <field name="status" update="set">one</field>
      </doc></add>
      <add><doc boost="1.0">
      <field name="id">test</field>
      <field name="status" update="add">two</field>
      </doc></add>
      

      Yields:

      <arr name="status"><str>one</str><str>two</str></arr>
      

      Oddly, it works fine as a singe request in JSON:

      curl -k 'http://localhost/solr/update?commit=true' -H 'Content-type:application/json' -d '["id":"test", {"status":{"set":["one", "two"]}}]'
      

      Yields:

      <arr name="status"><str>one</str><str>two</str></arr>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                shalin Shalin Shekhar Mangar
                Reporter:
                bbpennel Ben Pennell
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: