Solr atomic update JSON方式

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 if null 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":3},
  "cat_ss"     : {"add":"Cyberpunk"}
 }
]
原文地址:https://www.cnblogs.com/mysic/p/6075444.html