Using XML, you can send add
, commit
, optimize
, and delete
commands to Solr. Here is an XML sample for sending HTTP POST to Solr; this will add (or replace) documents:
<add overwrite="true"> <doc boost="2.0"> <field name="id">Artist:11650</field> <field name="type">Artist</field> <field name="a_name" boost="0.5">The Smashing Pumpkins</field> <!-- the date/time syntax MUST look just like this --> <field name="a_begin_date">2007-12-31T09:40:00Z</field> </doc> <doc> <field name="id">Artist:11651</field> <field name="type">Artist</field> <field name="a_begin_date">2007-12-31T09:40:00Z</field> </doc> <!-- more doc elements here as needed --> </add>