# Define a dynamic field in a non-dynamic object

**URL:** https://discuss.elastic.co/t/define-a-dynamic-field-in-a-non-dynamic-object/11077
**Category:** Elasticsearch
**Created:** [March 8, 2013, 3:50pm UTC](https://discuss.elastic.co/t/define-a-dynamic-field-in-a-non-dynamic-object/11077 "2013-03-08T15:50:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Daniel\_Gonzalez](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@Daniel\_Gonzalez](https://discuss.elastic.co/u/Daniel_Gonzalez)
#### Post date: [March 8, 2013, 3:50pm UTC](https://discuss.elastic.co/t/define-a-dynamic-field-in-a-non-dynamic-object/11077/1 "2013-03-08T15:50:07Z")

</div>

Hi,

As explained here[http://www.elasticsearch.org/guide/reference/mapping/object-type.html](http://www.elasticsearch.org/guide/reference/mapping/object-type.html) an  
object can be dynamic.

The example shows an object with the default value for dynamic (true), and  
disabling dynamic for a specific field ("name"). I want to do the opposite:  
I wand my object to be "not dynamic", but I want a specific field to be  
dynamic. I have defined the following mapping for that, but it is not  
working. Any idea why?

{  
"dynamic": "false",  
"properties": {  
"org\_id": {  
"index": "analyzed",  
"store": "yes",  
"type": "integer"  
},  
"properties": {  
"properties": {  
"keywordmap": {  
"dynamic": "true",  
"store": "yes",  
"type": "string"  
},  
"locator": {  
"store": "yes",  
"type": "string"  
},  
"multilocator": {  
"store": "yes",  
"type": "string"  
}  
}  
},  
"type": {  
"store": "yes",  
"type": "string"  
}  
}  
}

Thanks,  
Daniel Gonzalez

--  
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: ![Daniel\_Gonzalez](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@Daniel\_Gonzalez](https://discuss.elastic.co/u/Daniel_Gonzalez)
#### Post date: [March 8, 2013, 3:52pm UTC](https://discuss.elastic.co/t/define-a-dynamic-field-in-a-non-dynamic-object/11077/2 "2013-03-08T15:52:10Z")

</div>

To make it clear, the field I want to be dynamic is properties.keywordmap.

(unfortunately we are using "properties" too in our data model, so that  
this gets a bit confusing when configuring the ES mappings)

On Friday, March 8, 2013 4:50:07 PM UTC+1, Daniel Gonzalez wrote:

> Hi,
> 
> As explained here[http://www.elasticsearch.org/guide/reference/mapping/object-type.html](http://www.elasticsearch.org/guide/reference/mapping/object-type.html) an  
> object can be dynamic.
> 
> The example shows an object with the default value for dynamic (true), and  
> disabling dynamic for a specific field ("name"). I want to do the opposite:  
> I wand my object to be "not dynamic", but I want a specific field to be  
> dynamic. I have defined the following mapping for that, but it is not  
> working. Any idea why?
> 
> {  
> "dynamic": "false",  
> "properties": {  
> "org\_id": {  
> "index": "analyzed",  
> "store": "yes",  
> "type": "integer"  
> },  
> "properties": {  
> "properties": {  
> "keywordmap": {  
> "dynamic": "true",  
> "store": "yes",  
> "type": "string"  
> },  
> "locator": {  
> "store": "yes",  
> "type": "string"  
> },  
> "multilocator": {  
> "store": "yes",  
> "type": "string"  
> }  
> }  
> },  
> "type": {  
> "store": "yes",  
> "type": "string"  
> }  
> }  
> }
> 
> Thanks,  
> Daniel Gonzalez

--  
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: ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)
#### Post date: [March 8, 2013, 4:16pm UTC](https://discuss.elastic.co/t/define-a-dynamic-field-in-a-non-dynamic-object/11077/3 "2013-03-08T16:16:24Z")

</div>

On Fri, 2013-03-08 at 07:52 -0800, Daniel Gonzalez wrote:

> To make it clear, the field I want to be dynamic is  
> properties.keywordmap.

Only objects can be dynamic. keywordmap is a string

clint

> (unfortunately we are using "properties" too in our data model, so  
> that this gets a bit confusing when configuring the ES mappings)
> 
> On Friday, March 8, 2013 4:50:07 PM UTC+1, Daniel Gonzalez wrote:  
> Hi,
> 
> ```
> As explained here an object can be dynamic.
>     
>     
> The example shows an object with the default value for dynamic
> (true), and disabling dynamic for a specific field ("name"). I
> want to do the opposite: I wand my object to be "not dynamic",
> but I want a specific field to be dynamic. I have defined the
> following mapping for that, but it is not working. Any idea
> why?
>     
>     
> {
> "dynamic": "false",
> "properties": {
> "org_id": {
> "index": "analyzed",
> "store": "yes",
> "type": "integer"
> },
> "properties": {
> "properties": {
> "keywordmap": {
> "dynamic": "true",
> "store": "yes",
> "type": "string"
> },
> "locator": {
> "store": "yes",
> "type": "string"
> },
> "multilocator": {
> "store": "yes",
> "type": "string"
> }
> }
> },
> "type": {
> "store": "yes",
> "type": "string"
> }
> }
> }
>     
>     
> Thanks,
> Daniel Gonzalez
> 
> ```
> 
> --  
> 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).

--  
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:47am UTC](https://discuss.elastic.co/t/define-a-dynamic-field-in-a-non-dynamic-object/11077/4 "2017-07-06T02:47:28Z")

</div>


