Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Duplicate
-
4.0
-
None
-
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
- duplicates
-
SOLR-4134 Cannot "set" multiple values into multivalued field with partial updates when using the standard RequestWriter.
- Closed