Created
March 26, 2012 20:20
-
-
Save thesurlydev/2209383 to your computer and use it in GitHub Desktop.
ES update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map<String, Object> attachment = new HashMap<String, Object>(); | |
attachment.put("content", attachmentContent); | |
attachment.put("_indexed_chars", -1); // no limit | |
fileProperties.put("file", attachment); | |
fileProperties.put("postID", postID); | |
fileProperties.put("filename", file.getFilename()); | |
fileProperties.put("path", file.getPath()); | |
fileProperties.put("fileSize", file.getFileSize()); | |
UpdateResponse updateResponse = new UpdateRequestBuilder(transportClient, | |
"threads", | |
"thread, | |
threadID) | |
.setScript("ctx._source.files += file") | |
.addScriptParam("file", fileProperties) | |
.execute().actionGet(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment