You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Cassandra Targett (Jira)" <ji...@apache.org> on 2021/08/14 01:09:00 UTC

[jira] [Updated] (SOLR-11265) Add support for atomic updates to /update and /update/json for V2

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

Cassandra Targett updated SOLR-11265:
-------------------------------------
    Component/s: update

> Add support for atomic updates to /update and /update/json for V2
> -----------------------------------------------------------------
>
>                 Key: SOLR-11265
>                 URL: https://issues.apache.org/jira/browse/SOLR-11265
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>            Reporter: Ishan Chattopadhyaya
>            Priority: Major
>
> In V2 APIs, set, inc, etc. operations do not work with /update or /update/json. They work only with /update/json/commands.
> Steps to reproduce:
> {code}
> $ curl http://localhost:8983/api/collections/demo/update -d '
> [
>  {"id" : "book1",
>   "title_t" : "Snow Crash",    // text field
>   "copies_i" : 5,
>   "cat_ss" : "Science Fiction" // multi-valued string field
>  }
> ]'
> $ curl http://localhost:8983/api/collections/demo/update -d '
> [
>  {"id"         : "book1",
>   "author_s"   : {"set":"Neal Stephenson"},
>   "copies_i"   : {"inc":3},
>   "cat_ss"     : {"add":"Cyberpunk"}
>  }
> ]'
> {code}
> This results in the following document:
> {code}
> {
>         "id":"book1",
>         "author_s.set":["Neal Stephenson"],
>         "copies_i.inc":[3],
>         "cat_ss.add":["Cyberpunk"],
>         "_version_":1576306836595802112,
>         "cat_ss.add_str":["Cyberpunk"],
>         "author_s.set_str":["Neal Stephenson"]}]
>   }
> {code}
> Example from Yonik's blog: http://yonik.com/solr/atomic-updates/



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org