Details
Description
Atomic updates with a CloudSolrServer object instance doesn´t work properly.
- Code snippet:
// CloudSolrSever instance.
LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(solrEndpoints);
CloudSolrServer cloudSolrServer = new CloudSolrServer(zookeeperEndpoints, lbSolrServer);
// SolrInputDocument to update:
SolrInputDocument do = ne SolrInputDocument();
doc.addField("id", "myId");
Map<String, List<String>> operation = new HashMap<String, List<String>>();
operation.put("set", [[a list of String elements]]); // I want a set operation to override field values.
doc.addField("fieldName", operation);
// Atomic update operation.
cloudSolrServer.add(doc);
- Result:
doc: {
id: "myId",
fieldName: [ "
"
],
...
}
- Changing map from snippet like Map operation = new HashMap() instead of Map<String, List<String>> operation = new HashMap<String, List<String>>() obtains the following result after the atomic update:
doc: {
id: "myId",
fieldName: ["[Value1, Value2]"
],
...
}
- Also, the old value is never erased, and instead of a "set" operation an "add" operation happens.
CONCLUSION: during an atomic update with CloudSolrServer the List/Array/Object value passed is being processed with just a toString() method.
Attachments
Attachments
Issue Links
- duplicates
-
SOLR-4134 Cannot "set" multiple values into multivalued field with partial updates when using the standard RequestWriter.
- Closed