# How to set all scalar types (number/boolean/string etc) to be set to type "string" during dynamic mapping (using river plugin)

**URL:** <https://discuss.elastic.co/t/how-to-set-all-scalar-types-number-boolean-string-etc-to-be-set-to-type-string-during-dynamic-mapping-using-river-plugin/10273>\
**Category:** Elasticsearch\
**Created:** [January 8, 2013, 11:16pm UTC](https://discuss.elastic.co/t/how-to-set-all-scalar-types-number-boolean-string-etc-to-be-set-to-type-string-during-dynamic-mapping-using-river-plugin/10273 "2013-01-08T23:16:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadow](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@shadow](https://discuss.elastic.co/u/shadow)\
**Post date:** [January 8, 2013, 11:16pm UTC](https://discuss.elastic.co/t/how-to-set-all-scalar-types-number-boolean-string-etc-to-be-set-to-type-string-during-dynamic-mapping-using-river-plugin/10273/1 "2013-01-08T23:16:42Z")

</div>

Hi all...

This might be something really peculiar I'm trying to do. I'm running a "river" to dynamically index all data in my couchdb.  
As multiple users enter data into the system, sometimes there is a conflict in mapping (MapperParser Error). For example:  
userA adds the following data - {"tweet" : {"fooval" : "1"}}  
-- elasticSearch creates a Mapping for this "tweet.fooval" variable as Number (as it interpretes it as a number)  
userB adds the following data - {"tweet" : {"fooval" : "false"}}  
-- elasticSearch tries to create a Mapping for this "tweet.fooval" variable as Boolean (as it interpretes it as a Boolean) and hence a MapperParser Error.

I guess you see the problem. Also I only want to do it at the level of scalar types, as I dont want Arrays/Objects to be treated as strings. I want all scalar types to be treated as Strings while the mapping is being created.

I couldn't find anything on the doc page, or on the forum, so thought will ask here for directions/pointers.

Thanks  
Sunny

---

<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:57am UTC](https://discuss.elastic.co/t/how-to-set-all-scalar-types-number-boolean-string-etc-to-be-set-to-type-string-during-dynamic-mapping-using-river-plugin/10273/2 "2017-07-06T02:57:18Z")

</div>

Closed on July 6, 2017, 2:57am UTC


