Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-15827

Update documents by query

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • update

    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 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 --data-binary '{ "seller_name":  {"set":"John Doe"}}'
      

      end this request will update all the documents where seller_id=12345.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Ciorba Alex
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: