http://yonik.com/solr/atomic-updates/
Solr supports several modifiers that atomically update values of a document.
-
set
– set or replace a particular value, or remove the value ifnull
is specified as the new value -
add
– adds an additional value to a list -
remove
– removes a value (or a list of values) from a list -
removeregex
– removes from a list that match the given Java regular expression -
inc
– increments a numeric value by a specific amount (use a negative value to decrement)
Note: All original source fields must be stored for field modifiers to work correctly. This is the default in Solr.
[
{"id" : "book1",
"author_s" : {"set":"Neal Stephenson"},
"copies_i" : {"inc":},
"cat_ss" : {"add":"Cyberpunk"}
}
]