I wish I could, but currently prohibited. However, I can point you to some
very good Java libraries:
The CSV parser supplied by the Apache project works well:
You can override the delimiter using the static CSVFormat newFormat(char
delimiter) method which creates a new CSV format with the specified
Then use the XContentBuilder cb = jsonBuilder() method call to create a
content builder to convert your records to single-line JSON.
For example, the action and meta data object I use is based on the
following ENUM and toString method to emit as JSON. I've left out the parst
that I use in other custom libraries that allow Java code to easily set up
this information, and also to set this from a search response or a
public enum OpType
public String toString()
XContentBuilder cb = jsonBuilder();
if (id != null)
if (version > 0)
if (versionType == VersionType.EXTERNAL)
if (ttl != null)
catch (IOException e)
/* Operation type (action): "create" or "index" or "delete" */
private OpType opType = OpType.INDEX;
/* Metadata that this object supports */
private String index = null;
private String type = null;
private String id = null;
private long version = 0;
private VersionType versionType = VersionType.INTERNAL;
private TimeValue ttl = null;
And the actual data line that would follow is similarly constructed using
the content builder.
I wish I could help you more.
On Wednesday, January 7, 2015 10:41:26 AM UTC-5, Gopimanikandan Sengodan
Thank you brian. Let me change it accodingly as per your suggestion.
Could it possible to share the bulk load client and csv to json converter?
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9d46f746-04c6-48fe-93bc-a0c8612539ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.