Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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();
Add Comment
Please, Sign In to add comment