Creating a new index using TransportClient/NodeClient using Java API in ES 2.1


(Sushant Sood) #1

Hi All,
I am trying to create an index using NodeClient/TransportClient in ES 2.1 by calling client.index(request).get() and when the index gets created it is having a different Mapping created and does not match with the source

My Source which i provided to Index api :
"title":{"type":"string"},"description":{"type":"string"},"hits":{"type":"integer"},"columns":{"type":"string"},"sort":{"type":"string"},"version":{"type":"integer"}}"
:
Mapping Generated by ES :
create_mapping [type] with source [{"search":{"properties":{"columns":{"properties":{"type":{"type":"string"}}},"description":{"properties":{"type":{"type":"string"}}},"hits":{"properties":{"type":{"type":"string"}}},"sort":{"properties":{"type":{"type":"string"}}},"title":{"properties":{"type":{"type":"string"}}},"version":{"properties":{"type":{"type":"string"}}}}}}]

As you see every field is converted to PROPERTIES json object . I want it to remain as is the way i added in request . Can you please let me know if its a bug or i have to set any additional value in the request to that mapping should get generated as per the source I provided.


(system) #2