You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "HeXin (JIRA)" <ji...@apache.org> on 2013/08/27 17:49:51 UTC

[jira] [Created] (SOLR-5193) Atomic update should add function to check the whether uniqueKey is already existing

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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org