The index API (http://www.elasticsearch.org/guide/reference/java-api/index_.html) can accept any form of json data (byte array, a string). So, you can create your own json with your favorite json lib, and feed it to the index operation (using the several setSource methods).
There is a built in embedded API to generate json (or smile format, which is a binary json format created by the jackson lib). Thats the one used in the example in the link above. It as different startArray methods.
On Friday, February 10, 2012 at 5:33 PM, Shane Witbeck wrote:
I've been trying to figure out how to add a list of complex objects via the Java API as illustrated in the guide here:
Is there an example of how to do this?
I'd also be interested an example of how to populate the index via Java API.
I'm using version 0.18.7.