You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Alex (Jira)" <ji...@apache.org> on 2021/12/02 13:04:00 UTC

[jira] [Updated] (SOLR-15827) Update documents by query

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

Alex updated SOLR-15827:
------------------------
    Description: 
At the moment it is possible to update a document, or list of documents only by ID.
It will be very useful to support also update by some query different from ID.

In our case we have a shop where users can sell some products, so we store the product details along with seller details in same document.
And when we need to change the seller name, we need first to select all the products in order to have the IDs, and then update all the documents by IDs.

All this can be handled internally by Solr by supporting update by query.
The endpoint can look like 
POST [http://localhost:8983/solr/techproducts/update?query=seller_id:12345]

{ "seller_name":  \{"set":"John Doe"} }
{{end this request will update all the documents where seller_id=12345.}}

  was:
At the moment it is possible to update a document, or list of documents only by ID.
It will be very useful to support also update by some query different from ID.

In our case we have a shop where users can sell some products, so we store the product details along with seller details in same document.
And when we need to change the seller name, we need first to select all the products in order to have the IDs, and then update all the documents by IDs.

All this can be handled internally by Solr by supporting update by query.
The endpoint can look like 
POST http://localhost:8983/solr/techproducts/update?query=seller_id:12345
{ "seller_name": \{"set":"John Doe"} }
{{end this request will update all the documents where seller_id=12345.}}


> Update documents by query
> -------------------------
>
>                 Key: SOLR-15827
>                 URL: https://issues.apache.org/jira/browse/SOLR-15827
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: update
>            Reporter: Alex
>            Priority: Major
>              Labels: update
>
> At the moment it is possible to update a document, or list of documents only by ID.
> It will be very useful to support also update by some query different from ID.
> In our case we have a shop where users can sell some products, so we store the product details along with seller details in same document.
> And when we need to change the seller name, we need first to select all the products in order to have the IDs, and then update all the documents by IDs.
> All this can be handled internally by Solr by supporting update by query.
> The endpoint can look like 
> POST [http://localhost:8983/solr/techproducts/update?query=seller_id:12345]
> { "seller_name":  \{"set":"John Doe"} }
> {{end this request will update all the documents where seller_id=12345.}}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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