I am trying to POST data into elastic search using this below code in java.
Response indexResponse = restClient.performRequest("POST",
"/myindex/mydoc/",
Collections.<String, String>emptyMap(), entity);
My entity is JSON file which is like [{...},{...},{...}].
But I am getting below error:
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}},"status":400}.
I think the issue is in creating multiple documents at a time, can we do this using bulk API? how?