How do I use updateRequestBuilder.addScriptParam to add List/Arrays.
I want to replace "ctx._source.communities" with the list of maps called
"new_communities" but it always ends up as an empty array.
List<Map<String,Object>> communityMapList = new
for(CommunityRelationship community :
Map<String,Object> communityMap = new
communityMap.put("communityId", community.getCommunityId()); communityMap.put("communityName",
communityMapList.add(communityMap); } UpdateRequestBuilder updateRequestBuilder = client
.prepareUpdate(SearchFields.INDEX, SearchFields.USER_TYPE, userId)
.addScriptParam("new_communities", communityMapList) .setConsistencyLevel(WriteConsistencyLevel.ALL) .setRetryOnConflict(10) .setScript("ctx._source.communities = new_communities");
I've figured out how to pass in a single community append but I'd really
like to pass in a list of communities.
This seems a simple thing to do using json (Just write out the string
but I can't see how to pass this into the java api.
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e48362ad-e7d2-48df-ae3c-02c0ad867b3c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.