Hello,

I’m trying to Update a field in a document via SolrJ. Unfortunately, while the 
field itself is updated correctly, values of some other fields are removed.
The code looks like this:

SolrInputDocument updateDoc = new SolrInputDocument();

updateDoc.addField("id", "1234");

Map<String, Object> updateValue = new HashMap<>();
updateValue.put("set", 1);
updateDoc.addField("fieldToUpdate", updateValue);

final UpdateRequest request;

request = new UpdateRequest();
request.add(updateDoc);

request.process(solrClient, "myCollection");
solrClient.commit();


If I send a similar request with curl, e.g.

curl -X POST -H 'Content-Type: application/json' 
'http://localhost:8983/solr/myCollection/update' --data-binary '[{"id":"1234", 
"fieldToUpdate":{"set":"1"}}]'

it works as expected.
I’m using Solr 6.0.1, but the problem also occurs in 6.6.0.

Any ideas?

Thanks
Martin

Reply via email to