# Index Template and object type does not seem to work

**URL:** https://discuss.elastic.co/t/index-template-and-object-type-does-not-seem-to-work/11350
**Category:** Elasticsearch
**Created:** [March 28, 2013, 11:10am UTC](https://discuss.elastic.co/t/index-template-and-object-type-does-not-seem-to-work/11350 "2013-03-28T11:10:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![SomeUser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/someuser/32/2423_2.png) [@SomeUser](https://discuss.elastic.co/u/SomeUser)
#### Post date: [March 28, 2013, 11:10am UTC](https://discuss.elastic.co/t/index-template-and-object-type-does-not-seem-to-work/11350/1 "2013-03-28T11:10:07Z")

</div>

I'm trying to create an index template that looks like this:

{  
"template": "myindex\*",  
"order": 0,  
"mappings": {  
"obj1": {  
"properties": {  
"obj2": {  
"type": "object",  
"propterties": {  
"id": {  
"type": "string",  
"index": "not\_analyzed"  
},  
"name": {  
"type": "string",  
"index": "not\_analyzed"  
}  
}  
},  
"name": {  
"index": "not\_analyzed",  
"type": "string"  
}  
}  
}  
}  
}

When creating the index later on, the mapping looks like this:  
{  
"obj1": {  
"properties": {  
"obj2": {  
"type": "object"  
},  
"name": {  
"type": "string",  
"index": "not\_analyzed"  
}  
}  
}  
}

And when I index a document the mapping of fields "obj2.id" and "obj2.name"  
are dynamically created (with type string) but does not become  
"not\_analyzed" which is what I need them to be.

Any ideas? Is it not possible to use object mappings in index templates?

I'm running ES version 0.19.8.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![SomeUser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/someuser/32/2423_2.png) [@SomeUser](https://discuss.elastic.co/u/SomeUser)
#### Post date: [March 28, 2013, 11:16am UTC](https://discuss.elastic.co/t/index-template-and-object-type-does-not-seem-to-work/11350/2 "2013-03-28T11:16:20Z")

</div>

Never mind, the error was caused by a typo - saw it when I read my post  
after posting it.

On Thursday, March 28, 2013 12:10:07 PM UTC+1, SomeUser wrote:

> I'm trying to create an index template that looks like this:
> 
> {  
> "template": "myindex\*",  
> "order": 0,  
> "mappings": {  
> "obj1": {  
> "properties": {  
> "obj2": {  
> "type": "object",  
> "propterties": {  
> "id": {  
> "type": "string",  
> "index": "not\_analyzed"  
> },  
> "name": {  
> "type": "string",  
> "index": "not\_analyzed"  
> }  
> }  
> },  
> "name": {  
> "index": "not\_analyzed",  
> "type": "string"  
> }  
> }  
> }  
> }  
> }
> 
> When creating the index later on, the mapping looks like this:  
> {  
> "obj1": {  
> "properties": {  
> "obj2": {  
> "type": "object"  
> },  
> "name": {  
> "type": "string",  
> "index": "not\_analyzed"  
> }  
> }  
> }  
> }
> 
> And when I index a document the mapping of fields "obj2.id" and "obj2.name"  
> are dynamically created (with type string) but does not become  
> "not\_analyzed" which is what I need them to be.
> 
> Any ideas? Is it not possible to use object mappings in index templates?
> 
> I'm running ES version 0.19.8.

--  
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).  
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:43am UTC](https://discuss.elastic.co/t/index-template-and-object-type-does-not-seem-to-work/11350/3 "2017-07-06T02:43:57Z")

</div>


