2014-09-05 60 views
0

這是JSON格式的原子更新的主體。我複製從hereXML格式的solr原子更新

{"id":"mydoc","price":{"set":99},"popularity":{"inc":20},"categories":{"add":["toys","games"]}, "promo_ids":{"remove":"a123x"}, "tags":{"remove":["free_to_try","on_sale"]}} 

如何編寫XML格式的相同的代碼?

回答

1

請參閱wiki頁面中的section for Optional Attributes以獲取XML更新格式。

<add> 
    <doc> 
    <field name="employeeId">05991</field> 
    <field name="office" update="set">Walla Walla</field> 
    <field name="skills" update="add">Python</field> 
    </doc> 
</add>