Let me first explain my scenario. I am fetching data from RDBMS and pushing it into ElasticSearch. Fetched Results are in the form of List and i am preparing bulk index request like this:
BulkRequestBuilder bulkRequest = client.prepareBulk();
for (Map<String,Object> singleDataRow : ResultSet)
{
IndexRequest indexRequest = new IndexRequest("testindex","testtype",singleDataRow.getObject("NAME"));
bulkRequest.add(indexRequest);
}
bulkRequest.execute().actionGet();
My Map = includes Map of string to string, string to big decimal, string to big integer etc. eg.
{ BIRTHDATE : 2015-03-05 , NAME : deepankar , AGE : 22 , AMOUNT : 15.5 }
But when i see the mapping of my testtype in testindex, all mapping of fields are of "type" : "string"
Why the fields does not maps to "type": "string" , or "type" : "long" , and even "type" : "date" as elasticsearch does it by default?