I am using Bulk Java Api into ingest the data into the ElasticSearch.
JsonNode rootNode = mapper.readTree(json);
Iterator<Map.Entry<String,JsonNode>> fieldsIterator = rootNode.getFields();
Map<String, String> bulkData = new HashMap<String, String>();
while (fieldsIterator.hasNext()) {
Map.Entry<String,JsonNode> field = fieldsIterator.next();
bulkData.put(field.getKey(), field.getValue().toString());
}
bulkRequest.add(client.prepareIndex("Testing", "Test1")
.setSource(bulkData)
);
BulkResponse bulkResponse = bulkRequest.get();
if (bulkResponse.hasFailures()) {
System.out.println("A problem ocurred in the bulk process");
// process failures by iterating through each bulk response item
}
However, when I check the data in ElasticSearch, I get the following:
"Key" : """"Value""""
I checked my Hashmap values before inserting but it is fine.
What is the reason for the extra double quotes in the values of ElasticSearch?