HeXin created SOLR-5193:
---------------------------

             Summary: Atomic update should add function to check the whether 
uniqueKey is already existing
                 Key: SOLR-5193
                 URL: https://issues.apache.org/jira/browse/SOLR-5193
             Project: Solr
          Issue Type: Improvement
          Components: update
    Affects Versions: 4.4
            Reporter: HeXin



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 
before, 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"}
 }
]'


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