updateRequest.process(solrServer);
}
} else if (body instanceof SolrInputDocument) {
UpdateRequest updateRequest = new UpdateRequest(getRequestHandler());
updateRequest.add((SolrInputDocument) body);
if (isStreaming) {
updateRequest.process(streamingSolrServer);
} else {
updateRequest.process(solrServer);
}
} else {
boolean hasSolrHeaders = false;
Map<String, Object> headers = exchange.getIn().getHeaders();
for (Map.Entry<String, Object> entry : exchange.getIn().getHeaders().entrySet()) {
if (entry.getKey().startsWith(SolrConstants.FIELD)) {
hasSolrHeaders = true;
break;
}
}
if (hasSolrHeaders) {
UpdateRequest updateRequest = new UpdateRequest(getRequestHandler());
SolrInputDocument doc = new SolrInputDocument();
for (Map.Entry<String, Object> entry : exchange.getIn().getHeaders().entrySet()) {
if (entry.getKey().startsWith(SolrConstants.FIELD)) {
String fieldName = entry.getKey().substring(SolrConstants.FIELD.length());
doc.setField(fieldName, entry.getValue());
}
}
updateRequest.add(doc);
if (isStreaming) {
updateRequest.process(streamingSolrServer);
} else {
updateRequest.process(solrServer);
}
} else if (body instanceof String) {
String bodyAsString = (String) body;