...
Below is a simple INSERT example in Java and Spring XML.
Code Block | ||||
---|---|---|---|---|
| ||||
from("direct:start") .setHeader(SolrConstants.OPERATION, constant(SolrConstants.OPERATION_INSERT)) .setHeader(SolrConstants.FIELD + "id", body()) .to("solr://localhost:8983/solr"); |
Code Block | ||||
---|---|---|---|---|
| ||||
<route> <from uri="direct:start"/> <setHeader headerName="SolrOperation"> <constant>INSERT</constant> </setHeader> <setHeader headerName="SolrField.id"> <simple>${body}</simple> </setHeader> <to uri="solr://localhost:8983/solr"/> </route> |
A client would simply need to pass a String body message to this route as follows.
...