# Dynamic mapping all fields as string

**URL:** <https://discuss.elastic.co/t/dynamic-mapping-all-fields-as-string/171490>\
**Category:** Elasticsearch\
**Created:** [March 8, 2019, 12:23pm UTC](https://discuss.elastic.co/t/dynamic-mapping-all-fields-as-string/171490 "2019-03-08T12:23:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanthkadem](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/srikanthkadem/32/40018_2.png) [@srikanthkadem](https://discuss.elastic.co/u/srikanthkadem)\
**Post date:** [March 8, 2019, 12:23pm UTC](https://discuss.elastic.co/t/dynamic-mapping-all-fields-as-string/171490/1 "2019-03-08T12:23:35Z")

</div>

Hi,  
I am using dynamic mapping, to enable partial search I am adding \* at end of user entered keyword. the problem is this approach is only searching in string/keyword fields. to overcome this limitation, i want to store every field as string so that wild card search will work. I want to understand if we face any problems in storing everything in string format ..  
can I able to filter records based on dates(greater than some date?) if the fields are in string format....  
Any alternate solution will also be helpful for me

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 8, 2019, 1:18pm UTC](https://discuss.elastic.co/t/dynamic-mapping-all-fields-as-string/171490/2 "2019-03-08T13:18:03Z")

</div>

Usage of wildcards is slow. So unless you are ok with slow response time, I'd encourage you looking at an edge ngram strategy.

---

<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:** [April 5, 2019, 1:18pm UTC](https://discuss.elastic.co/t/dynamic-mapping-all-fields-as-string/171490/3 "2019-04-05T13:18:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
