# Mapping all Bools as String

**URL:** <https://discuss.elastic.co/t/mapping-all-bools-as-string/265583>\
**Category:** Elasticsearch\
**Created:** [February 26, 2021, 9:17am UTC](https://discuss.elastic.co/t/mapping-all-bools-as-string/265583 "2021-02-26T09:17:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott\_stash](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@scott\_stash](https://discuss.elastic.co/u/scott_stash)\
**Post date:** [February 26, 2021, 9:17am UTC](https://discuss.elastic.co/t/mapping-all-bools-as-string/265583/1 "2021-02-26T09:17:41Z")

</div>

When my logstash starts it sends a template to ES where I set the mappings for various fields. I'm getting a lot of conflicts on a lot of fields(150+) that I do not have individual mappings for. These are dynamic as they are the results of json parsing.

Is it possible to just save all boolean values as string?

```auto
                "bool_fields": {
                    "match": "*",
                    "match_mapping_type": "boolean",
                    "mapping": {
                        "type": "keyword",
                        "index": true
                    }
                }

```

I tried adding this to my template, but it doesn't appear to be working. I could limit it this to fields that start with comp, my fields can be like [comp][result][status], as almost all the fields are the sub elements of comp.

---

<div class="post-metadata">

**Author:** ![scott\_stash](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@scott\_stash](https://discuss.elastic.co/u/scott_stash)\
**Post date:** [March 5, 2021, 9:35am UTC](https://discuss.elastic.co/t/mapping-all-bools-as-string/265583/2 "2021-03-05T09:35:22Z")

</div>

In good news this worked for me in the end:

```
			{
            "boolean_fields": {
                "match": "cmp*",
                "match_mapping_type": "boolean",
                "mapping": {
                    "type": "keyword",
                    "index": true,
                    "norms": false,
                    "ignore_above": 10000
                }
            }
		}
```

---

<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 2, 2021, 9:35am UTC](https://discuss.elastic.co/t/mapping-all-bools-as-string/265583/3 "2021-04-02T09:35:43Z")

</div>

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