<route>
<from uri="direct:insert"/>
<setHeader headerName="SolrOperation">
<constant>INSERT</constant>
</setHeader>
<setHeader headerName="SolrField.id">
<simple>${body}</simple>
</setHeader>
<to uri="solr://localhost:8983/solr"/>
</route>
This is sample code to set ${body} to a ‘id’ field, but since it supports message body as SolrInputDocument or equivalent XML, how am I suppose to do that in above XML route?
if you have the SolrInputDocument, then just pass it as the body of a message to the route and make sure the OPERATION header is set appropriately…
see the unit tests for more information…
https://svn.apache.org/repos/asf/camel/trunk/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrUpdateTest.java