# Mapping nested type

**URL:** <https://discuss.elastic.co/t/mapping-nested-type/14612>\
**Category:** Elasticsearch\
**Created:** [November 27, 2013, 9:52am UTC](https://discuss.elastic.co/t/mapping-nested-type/14612 "2013-11-27T09:52:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul1/32/46819_2.png) [@paul1](https://discuss.elastic.co/u/paul1)\
**Post date:** [November 27, 2013, 9:52am UTC](https://discuss.elastic.co/t/mapping-nested-type/14612/1 "2013-11-27T09:52:44Z")

</div>

In the below url they have explained nested types but how to specify type  
to nested properties

[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-nested-type.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-nested-type.html)

Example given

{  
"obj1" : [  
{  
"name" : "blue",  
"count" : 4  
},  
{  
"name" : "green",  
"count" : 6  
}  
]  
}

Mapping given

{  
"type1" : {  
"properties" : {  
"obj1" : {  
"type" : "nested"  
}  
}  
}  
}

We say type is "nested" But how to map name to string and count to int ??

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/74530e0c-a651-4145-9119-db4b33aeae7b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/74530e0c-a651-4145-9119-db4b33aeae7b%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![paul1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul1/32/46819_2.png) [@paul1](https://discuss.elastic.co/u/paul1)\
**Post date:** [November 27, 2013, 10:44am UTC](https://discuss.elastic.co/t/mapping-nested-type/14612/2 "2013-11-27T10:44:07Z")

</div>

found the answer in

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

by using properties

On Wednesday, 27 November 2013 15:22:44 UTC+5:30, paul wrote:

> In the below url they have explained nested types but how to specify type  
> to nested properties
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-nested-type.html)
> 
> Example given
> 
> {  
> "obj1" : [  
> {  
> "name" : "blue",  
> "count" : 4  
> },  
> {  
> "name" : "green",  
> "count" : 6  
> }  
> ]  
> }
> 
> Mapping given
> 
> {  
> "type1" : {  
> "properties" : {  
> "obj1" : {  
> "type" : "nested"  
> }  
> }  
> }  
> }
> 
> We say type is "nested" But how to map name to string and count to int ??

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e18c492a-cae3-46a3-b2b0-d66acfb5cb30%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e18c492a-cae3-46a3-b2b0-d66acfb5cb30%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:04am UTC](https://discuss.elastic.co/t/mapping-nested-type/14612/3 "2017-07-06T02:04:37Z")

</div>


