Hi everyone, 

I am using currently Apache Camel 2.24.3 and trying to integrate a system with 
a Solr index. On the Solr side we've been working with Unique IDs in form of a 
UUID, which will get updates during the whole workflow.

I've been having trouble with the Camel Component, when trying to update those 
IDs. It seems that it's working, but on the Solr side it will add a new 
document, instead of updating the existing one.

The used code looks like this:

(Note: the filename will contain the UUID I want to update, the document has 
the Solr XML structure

from("file:data?antInclude=*.xml")
                .log("[SOLR UPDATE]: ${header.CamelFileName} is being 
processed. ID: ${file:onlyname.noext}")
                .setHeader(SolrConstants.FIELD + "objID", 
simple("${file:onlyname.noext}"))
                .setHeader(Exchange.CONTENT_TYPE, constant("text/xml"))
                .setHeader(Exchange.FILE_CONTENT_TYPE, constant("text/xml"))
                .setHeader(SolrConstants.OPERATION, 
constant(SolrConstants.OPERATION_INSERT))
                .to("solr://" + solrURL) 
                ;


I have tried to delete the existing ID and then adding it again, but that case 
won't work as well...

I appreciate your advice and help you can provide. Thank you very much!!

Best regards

-- 
Jaime Penagos


Reply via email to