Ben Pennell created SOLR-4294:
---------------------------------

             Summary: Solr 4 atomic update incorrect value when setting two or 
more values to a multivalue via XML update
                 Key: SOLR-4294
                 URL: https://issues.apache.org/jira/browse/SOLR-4294
             Project: Solr
          Issue Type: Bug
          Components: clients - java, update
    Affects Versions: 4.0
         Environment: RHEL
            Reporter: Ben Pennell
            Priority: Minor
             Fix For: 4.0.1, 4.1


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.

{code}
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>'
{code}
    Yields the following in Solr:
{code}
  <arr name="status"><str>{set=one}</str><str>{set=two}</str></arr>
{code}

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

  If I only set one value though, it works correctly:
{code}
<add><doc boost="1.0">
<field name="id">test</field>
<field name="status" update="set">one</field>
</doc></add>
{code}
  Yields:
{code}
<arr name="status"><str>one</str></arr>
{code}

  It also works fine if I split it into two operations
{code}
<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>
{code}
  Yields:
{code}
<arr name="status"><str>one</str><str>two</str></arr>
{code}

  Oddly, it works fine as a singe request in JSON:
{code}
curl -k 'http://localhost/solr/update?commit=true' -H 
'Content-type:application/json' -d '["id":"test", {"status":{"set":["one", 
"two"]}}]'
{code}
  Yields:
{code}
<arr name="status"><str>one</str><str>two</str></arr>
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to