Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The "UpdateJSON" page has been changed by TadhgMulkern: http://wiki.apache.org/solr/UpdateJSON?action=diff&rev1=11&rev2=12 }' }}} + == Solr 4.0 Example == + === Atomic Updates === + Solr 4.0 supports atomic updates and allows you to add, set and inc (increment on numeric fields). + Example: + {{{ + curl http://localhost:8983/solr/update -H 'Content-type:application/json' -d ' + { + "id" : "TestDoc1", + "title" : {"set":"test1"}, + "revision" : {"inc":3}, + "publisher" : {"add":"TestPublisher"} + }' + }}} + + == Atomic Updates with Optimistic Concurrency == + Solr 4.0 supports comes with a build in _version_ field that is automatically added by Solr, that allows you to perform [[Optimistic_Concurrency]] on Atomic Updates. + Example: + {{{ + curl http://localhost:8983/solr/update -H 'Content-type:application/json' -d ' + { + "id" : "TestDoc1", + "title" : {"set":"test1"}, + "revision" : {"inc":3}, + "publisher" : {"add":"TestPublisher"} + "_version_" : {12345} + }' + }}} +