I am able to perform the xml atomic update properly using curl commands.
However the moment I try to achieve the same using the solrj APIs I am
facing problems.

What should be the equivalent SOLRJ api code to perform similar action
using the below CURL command ?

curl "http://search1.es.dupont.com:8080/solr/core1/update"; -H
"Content-Type: text/xml" --data-binary "<add><doc><field
name=\"id\">uniqueid</field><field name=\"tags\"
update=\"add\">updatefieldvalue</field></doc></add>"

I have attempted below code but it fails to add the field in proper manner
as it get set as {add=[updatefieldvalue]}.

QueryResponse qs2 = solr.query(params2);
Map<String, List<String>> operation = new HashMap<String, List<String>>();
List<String> vals = new ArrayList<String>();
vals.add(tag);
SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", (String)qs2.getResults().get(j).get("id"));
operation.put("add",vals);
doc.addField("tags", operation);

Thanks in advance for any inputs.

Regards
Anupam

Reply via email to