XContentBuilder xContentBuilder = jsonBuilder().startObject();
for (int i = 0; i < fielddata.length; i++) {
xContentBuilder.field(fielddata[i], fielddata[++i]);
}
xContentBuilder.endObject();
putDocument(dbName, id, xContentBuilder.string());
}
public static void putDocumentWithAttachments(String dbName, String id, List<String> doc, String... attachments) throws IOException {
XContentBuilder xContentBuilder = jsonBuilder()
.startObject()