# Store json field as string and still being indexed

**URL:** https://discuss.elastic.co/t/store-json-field-as-string-and-still-being-indexed/22422
**Category:** Elasticsearch
**Created:** [February 26, 2015, 11:03pm UTC](https://discuss.elastic.co/t/store-json-field-as-string-and-still-being-indexed/22422 "2015-02-26T23:03:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jlam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jlam/32/878_2.png) [@jlam](https://discuss.elastic.co/u/jlam)
#### Post date: [February 26, 2015, 11:03pm UTC](https://discuss.elastic.co/t/store-json-field-as-string-and-still-being-indexed/22422/1 "2015-02-26T23:03:34Z")

</div>

Hi,

For complex json document, is it possible to define a custom mapping to  
just store a json field (contains inner level json fields) as just strings  
and still being searchable?

for example:

"data1" : {  
"data2" : {  
"int\_data1": "sdfsfs",  
"int\_data2": "sdfassdfa"  
},  
"data3" : "etstasd"  
}

Have ES store "data2" as string and indexed. Is that possible?

Thanks,  
Jared

--  
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/13e8a350-9403-498a-8c40-34be7aa087e0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/13e8a350-9403-498a-8c40-34be7aa087e0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:29am UTC](https://discuss.elastic.co/t/store-json-field-as-string-and-still-being-indexed/22422/2 "2017-07-06T00:29:43Z")

</div>


