Using atomic updates in Solr

Atomic updates in Solr support the following sets of modifiers:

  • set: This modifier sets or replaces a particular indexed field value
  • add: This modifier inserts an additional value into the multi-valued fields
  • inc: This modifier increments a numeric value

Let's see how we can update our index documents using atomic updates. To do this, we'll use the musicCatalog commit core that we've created in this chapter.

Let's index a new music album with some wrong values, which we will later update using the atomic update feature:

$ curl http://localhost:8983/solr/musicCatalog-commit/update -H "Content-Type: text/xml" --data-binary @sampleAlbumData4.xml
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int ...

Get Apache Solr for Indexing Data now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.