# MappingMetaData json

**URL:** <https://discuss.elastic.co/t/mappingmetadata-json/5450>\
**Category:** Elasticsearch\
**Created:** [September 26, 2011, 1:44pm UTC](https://discuss.elastic.co/t/mappingmetadata-json/5450 "2011-09-26T13:44:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ridvan\_Gyundogan](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Ridvan\_Gyundogan](https://discuss.elastic.co/u/Ridvan_Gyundogan)\
**Post date:** [September 26, 2011, 1:44pm UTC](https://discuss.elastic.co/t/mappingmetadata-json/5450/1 "2011-09-26T13:44:41Z")

</div>

Hello,

I have a json file containing the elasticsearch mapping for a type -  
let's call it "mapping.json".

Currently we use Map\<String, Object\> mapping =  
mapper.readValue(mappingFileContent, HashMap.class) and then  
mapping.get("properties") to get the list of properties etc. We prefer  
if there was something like ElasticMapping.class so that we can say  
ElasticMapping elasticMapping = mapper.readValue(mappingFileContent,  
ElasticMapping.class) .

And then elasticMapping.getProperties().get(0).getType() ....

I see there is MappingMetadata.class but it doesn't look that it is  
created with this purpose?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 26, 2011, 4:02pm UTC](https://discuss.elastic.co/t/mappingmetadata-json/5450/2 "2011-09-26T16:02:56Z")

</div>

There isn't a static view of the mapping at the level (classes that map one  
to one, fields wise, to how the mappings are defined), its not needed in  
elasticsearch.

On Mon, Sep 26, 2011 at 4:44 PM, Ridvan Gyundogan [ridvansg@gmail.com](mailto:ridvansg@gmail.com)wrote:

> Hello,
> 
> I have a json file containing the elasticsearch mapping for a type -  
> let's call it "mapping.json".
> 
> Currently we use Map\<String, Object\> mapping =  
> mapper.readValue(mappingFileContent, HashMap.class) and then  
> mapping.get("properties") to get the list of properties etc. We prefer  
> if there was something like ElasticMapping.class so that we can say  
> ElasticMapping elasticMapping = mapper.readValue(mappingFileContent,  
> ElasticMapping.class) .
> 
> And then elasticMapping.getProperties().get(0).getType() ....
> 
> I see there is MappingMetadata.class but it doesn't look that it is  
> created with this purpose?

---

<div class="post-metadata">

**Author:** ![Ridvan\_Gyundogan](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Ridvan\_Gyundogan](https://discuss.elastic.co/u/Ridvan_Gyundogan)\
**Post date:** [September 26, 2011, 6:26pm UTC](https://discuss.elastic.co/t/mappingmetadata-json/5450/3 "2011-09-26T18:26:45Z")

</div>

We will probably create one for our custom needs. Ok, thanks for the  
fast answer.

On Sep 26, 7:02 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> There isn't a static view of the mapping at the level (classes that map one  
> to one, fields wise, to how the mappings are defined), its not needed in  
> elasticsearch.
> 
> On Mon, Sep 26, 2011 at 4:44 PM, Ridvan Gyundogan [ridva...@gmail.com](mailto:ridva...@gmail.com)wrote:
> 
> > Hello,
> 
> > I have a json file containing the elasticsearch mapping for a type -  
> > let's call it "mapping.json".
> 
> > Currently we use Map\<String, Object\> mapping =  
> > mapper.readValue(mappingFileContent, HashMap.class) and then  
> > mapping.get("properties") to get the list of properties etc. We prefer  
> > if there was something like ElasticMapping.class so that we can say  
> > ElasticMapping elasticMapping = mapper.readValue(mappingFileContent,  
> > ElasticMapping.class) .
> 
> > And then elasticMapping.getProperties().get(0).getType() ....
> 
> > I see there is MappingMetadata.class but it doesn't look that it is  
> > created with this purpose?

---

<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 6, 2017, 3:53am UTC](https://discuss.elastic.co/t/mappingmetadata-json/5450/4 "2017-07-06T03:53:33Z")

</div>


