|
http://solr.pl/en/2012/07/09/solr-4-0-partial-documents-update/
SolrInputDocument doc = new SolrInputDocument();
Map partialUpdate = new HashMap();
partialUpdate.put("set", "foo");
doc.addField("id", "test_123");
doc.addField("description", partialUpdate);
yields this document:
test_123
foo
The key of the hash map can be one of three values:
- set - to set a field.
- add - to add to a multi-valued field.
- inc - to increment a field.
There is an example of this code in the solrj unit tests, in a method called testUpdateField.
json curl 'localhost:8983/solr/update?commit=true' -H 'Content-type:application/json'-d '[{"id":"1","price":{"set":100}}]' |
|
|