Skip to content

Instantly share code, notes, and snippets.

@johtani
Created July 12, 2016 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johtani/9284cacd553cd46072f5d2aeabfe7c66 to your computer and use it in GitHub Desktop.
Save johtani/9284cacd553cd46072f5d2aeabfe7c66 to your computer and use it in GitHub Desktop.
String json = "{" +
"\"user\":\"kimchy\"\n," +
"\"postDate\":\"2013-01-30\"," +
"\"message\":\"trying out Elasticsearch\"" +
"}";
BulkRequestBuilder bulkRequest = client.prepareBulk();
bulkRequest.add(client.prepareIndex("test1", "tweet", "id1").setSource(json));
bulkRequest.add(client.prepareIndex("test1", "tweet", "id2").setSource(json));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment