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

**URL:** <https://discuss.elastic.co/t/creating-a-new-index-using-transportclient-nodeclient-using-java-api-in-es-2-1/37959>\
**Category:** Elasticsearch\
**Created:** [December 24, 2015, 10:05pm UTC](https://discuss.elastic.co/t/creating-a-new-index-using-transportclient-nodeclient-using-java-api-in-es-2-1/37959 "2015-12-24T22:05:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![soodlikesjava](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@soodlikesjava](https://discuss.elastic.co/u/soodlikesjava)\
**Post date:** [December 24, 2015, 10:05pm UTC](https://discuss.elastic.co/t/creating-a-new-index-using-transportclient-nodeclient-using-java-api-in-es-2-1/37959/1 "2015-12-24T22:05:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:28pm UTC](https://discuss.elastic.co/t/creating-a-new-index-using-transportclient-nodeclient-using-java-api-in-es-2-1/37959/2 "2017-07-05T23:28:41Z")

</div>


