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

Hoss Man updated SOLR-5193:
---------------------------

          Component/s:     (was: update)
                       documentation
          Description: 
Atomic Update features are mentioned in passing in the Ref Guide, but not 
explained as well as on the wiki (and doesn't refer to it as "atomic updates" 
so it's hard to find)

https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers#UploadingDatawithIndexHandlers-UpdatingOnlyPartofaDocument
https://wiki.apache.org/solr/Atomic_Updates

In particula, The Optimistic Concurrency options on atomic updatesare not 
really documented at all.

---

(Initial issue description requested a "check" option that could be used on the 
uniqueKey field when doing atomic updates that would cause hte updated to fail 
if the uniqueKey specified did not exist -- but this type of feature is not 
needed since we already support the equivilent optimisitic concurrency 
garuntees )




  was:
When we use below code to update doc:
curl http://localhost:8983/solr/update -H 'Content-type:application/json' -d '
[
 {
  "id"        : "TestDoc1",
  "publisher" : {"set":"TestPublisher"}
 }
]'
Sometimes we want that the publisher field updates only when the id of TestDoc1 
has already existed in solr. Because if the "TestDoc1" doesn't exist in solr, 
it is useless to add just one field for the doc. 

Therefore, i think we can support additional syntax tocheck whether the 
uniquekey is already existing just like below: 
curl http://localhost:8983/solr/update -H 'Content-type:application/json' -d '
[
 {
  "id"        : {"check": "TestDoc1"}
  "publisher" : {"set":"TestPublisher"}
 }
]'


    Affects Version/s:     (was: 4.4)
        Fix Version/s:     (was: 4.5)
                           (was: 5.0)
              Summary: Need better docs about Atomic Updates + Optimistic 
Concurrency  (was: Atomic update should add one function to check whether the 
uniqueKey is already existing)

HeXin: the basic cncept you are request already exists by using the optimistic 
concurrency features.

instead of a "check" operator that could only be used on the uniqueKey field, 
the same type of assertion can be made by sending a {{_version_}} of "1" which 
requires that the document exist (but doesn't care what it's current version 
is).

This isn't really documented in a straightforward manner anywhere so i've 
re-purposed your feature request into a documentation request...

http://yonik.com/solr/optimistic-concurrency/


                
> Need better docs about Atomic Updates + Optimistic Concurrency
> --------------------------------------------------------------
>
>                 Key: SOLR-5193
>                 URL: https://issues.apache.org/jira/browse/SOLR-5193
>             Project: Solr
>          Issue Type: Improvement
>          Components: documentation
>            Reporter: HeXin
>            Priority: Minor
>
> Atomic Update features are mentioned in passing in the Ref Guide, but not 
> explained as well as on the wiki (and doesn't refer to it as "atomic updates" 
> so it's hard to find)
> https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers#UploadingDatawithIndexHandlers-UpdatingOnlyPartofaDocument
> https://wiki.apache.org/solr/Atomic_Updates
> In particula, The Optimistic Concurrency options on atomic updatesare not 
> really documented at all.
> ---
> (Initial issue description requested a "check" option that could be used on 
> the uniqueKey field when doing atomic updates that would cause hte updated to 
> fail if the uniqueKey specified did not exist -- but this type of feature is 
> not needed since we already support the equivilent optimisitic concurrency 
> garuntees )

--
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