[ 
https://issues.apache.org/jira/browse/SOLR-4127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hoss Man updated SOLR-4127:
---------------------------

    Attachment: SOLR-4127.patch

Patch that adds tests for two scenerios:

* updateLog is not in use, but distrib processor is in the chain
* distrib processor is not in the chainat all

In both cases we assert that a useful error is thrown if the document contains 
atomic update instructions, via three modifications:

1) refactored "isAtomicUpdate(AddUpdateCommand)" (ie: a field value is a map) 
into existences
2) distrib processor throws an error if updateLog is not configured but the 
command isAtomicUpdate
3) run processor throws an error if it is given a command that isAtomicUpdate

(this way even if someone really wants to use their own distrib processor, they 
can still use atomic updates as long as they implement it and process the maps 
before the docs make it to the run processor)
                
> Atomic updates used w/o updateLog should throw an error
> -------------------------------------------------------
>
>                 Key: SOLR-4127
>                 URL: https://issues.apache.org/jira/browse/SOLR-4127
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 4.0
>            Reporter: Lukas Graf
>         Attachments: SOLR-4127.patch
>
>
> The atomic update feature described in 
> [SOLR-139|https://issues.apache.org/jira/browse/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:
> {code}
> $ curl 'localhost:8983/solr/update?commit=true' -H 
> 'Content-type:application/json' -d '
> [{"id":"7cb8a43c","Title":"My original Title", "Creator": "John Doe"}]'
> {code}
> Which resulted in this document:
> {code:xml}
> <doc>
>     <str name="id">7cb8a43c</str>
>     <str name="Title">My original Title</str>
>     <str name="Creator">John Doe</str>
> </doc>
> {code}
> Then I attempted to update that document with this statement:
> {code}
> $ curl 'localhost:8983/solr/update?commit=true' -H 
> 'Content-type:application/json' -d '
> [{"id":"7cb8a43c","Title":{"set":"My new title"}}]'
> {code}
> Which resulted in this garbled document, with the fields that weren't updated 
> missing:
> {code:xml}
> <doc>
>     <str name="id">7cb8a43c</str>
>     <str name="Title">{set=My new title}</str>
> </doc>
> {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