# How to store dynamic fields?

**URL:** <https://discuss.elastic.co/t/how-to-store-dynamic-fields/15935>\
**Category:** Elasticsearch\
**Created:** [February 20, 2014, 11:33pm UTC](https://discuss.elastic.co/t/how-to-store-dynamic-fields/15935 "2014-02-20T23:33:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnrodey](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@johnrodey](https://discuss.elastic.co/u/johnrodey)\
**Post date:** [February 20, 2014, 11:33pm UTC](https://discuss.elastic.co/t/how-to-store-dynamic-fields/15935/1 "2014-02-20T23:33:20Z")

</div>

I have a hashmap that I want to be searchable and can always have unique keys, let's say my first map is...

characteristics=[  
"height":"72",  
"weight":"180",  
"eyecolor":blue"]

The next map may have different values, say...

characteristics=[  
"brickcolor":"red",  
"cost":"100000"]

I want a user to be able to search for characteristics.brickcolor=brown or characteristics.cost\>=50000. So far I have accomplished this by using nested types, like...

"properties":{  
"characteristics":{"type":"nested"},  
...

This works great for search, but here's my question. How do I store all the fields that get created, without enabling the \_source field?

This doesn't seem to work:  
"properties":{  
"characteristics":{"type":"nested", "store":"yes"},  
...

Do I need to use dynamic templates? Note that I still want to allow elasticsearch to auto define my types for these fields. Any help is greatly appreciated!!!

---

<div class="post-metadata">

**Author:** ![johnrodey](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@johnrodey](https://discuss.elastic.co/u/johnrodey)\
**Post date:** [February 24, 2014, 7:34pm UTC](https://discuss.elastic.co/t/how-to-store-dynamic-fields/15935/2 "2014-02-24T19:34:02Z")

</div>

resubmitting...

---

<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, 1:47am UTC](https://discuss.elastic.co/t/how-to-store-dynamic-fields/15935/3 "2017-07-06T01:47:42Z")

</div>


