Solr atomic update JSON方式

http://yonik.com/solr/atomic-updates/express

Solr supports several modifiers that atomically update values of a document.atom

  • 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.spa

[
 {"id"         : "book1",
  "author_s"   : {"set":"Neal Stephenson"},
  "copies_i"   : {"inc":3},
  "cat_ss"     : {"add":"Cyberpunk"}
 }
]
相關文章
相關標籤/搜索