lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luis Cappa Banda <luisca...@gmail.com>
Subject SolrJ: atomic updates.
Date Thu, 15 Nov 2012 09:19:10 GMT
Hello everyone,

I´ve tested atomic updates via Ajax calls and now I´m starting with atomic
updates via SolrJ... but the way I´m proceeding doesn´t seem to work well.
Here is the snippet:

*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);*
*
*
*cloudSolrServer.add(doc); // Atomic update operation.*


And after updating the resultant doc is as follows:

*doc: {*
*
*
*...*
*
*
*fieldName: [ "{set=values}"*
*],*
*
*
*...*

*
*

*}*

In other words, the map which includes the "set" operation and the field
values is String formatted and that String is used to update the field, :-/

What is the correct way to update just one or more fields with SolrJ?


Regards,

-- 

- Luis Cappa

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message