Created
October 24, 2011 01:28
-
-
Save tallpsmith/1308172 to your computer and use it in GitHub Desktop.
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
BulkRequest bulkRequest = new BulkRequestBuilder(client).request(); | |
URL bulkIndexRequest = this.getClass().getResource("es-bulkindex.json"); | |
CountingOutputStream countingOutputStream = new CountingOutputStream(new NullOutputStream()); | |
ByteStreams.copy(bulkIndexRequest.openStream(), countingOutputStream); | |
long numBytes = countingOutputStream.getCount(); | |
bulkRequest.add(ByteStreams.toByteArray(bulkIndexRequest.openStream()), 0, (int) numBytes, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment