# Elastic mapping Issue

**URL:** <https://discuss.elastic.co/t/elastic-mapping-issue/364426>\
**Category:** Elasticsearch\
**Created:** [August 5, 2024, 11:49pm UTC](https://discuss.elastic.co/t/elastic-mapping-issue/364426 "2024-08-05T23:49:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![linux\_admin](https://avatars.discourse-cdn.com/v4/letter/l/c0e974/32.png) [@linux\_admin](https://discuss.elastic.co/u/linux_admin)\
**Post date:** [August 5, 2024, 11:49pm UTC](https://discuss.elastic.co/t/elastic-mapping-issue/364426/1 "2024-08-05T23:49:59Z")

</div>

I am using ELK version 8.12.0. I have a field called

> 'request.querystring.username'

and that field has different data types keyword and boolean in different indices.

- Why the same field has the same different data types in different indices?
- How to list the indices which contains the boolean data type for that field?
- How to fix the data type as keyword for the same field in the future?

---

<div class="post-metadata">

**Author:** ![czek0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/czek0/32/136480_2.png) [@czek0](https://discuss.elastic.co/u/czek0)\
**Post date:** [August 6, 2024, 7:45am UTC](https://discuss.elastic.co/t/elastic-mapping-issue/364426/2 "2024-08-06T07:45:50Z")

</div>

Hello

1. This could be an index mapping problem, try GET \<index\_name\>/mapping for each index to check how the fields are being mapped to
2. reindex and into a new index and change the alias name to the old index name
3. You can have a look into dynamic mapping or setting up an index template so that field will be mapped as a keyword in future data ingestions

---

<div class="post-metadata">

**Author:** ![kishorkumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kishorkumar/32/132930_2.png) [@kishorkumar](https://discuss.elastic.co/u/kishorkumar)\
**Post date:** [August 6, 2024, 8:31am UTC](https://discuss.elastic.co/t/elastic-mapping-issue/364426/3 "2024-08-06T08:31:17Z")

</div>

> [@linux\_admin](#):
>
> > 'request.querystring.username'

```auto
GET index_name/_mapping

```

or

```auto
GET index_name/_mapping/field/request

```

either create component template or just recreate the index template  
again set the mapping for that particular object request

```auto
"request": {
    "properties":{
         "querystring": {
             "properties": {
                  "username" : {
                      "type":"keyword" 
                  }
             }
          }
     }
}

```

and reindex the data after completely deleting the existing index

---

<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:** [August 6, 2024, 12:45pm UTC](https://discuss.elastic.co/t/elastic-mapping-issue/364426/4 "2024-08-06T12:45:18Z")

</div>

From #Elastic Search to #Elasticsearch

---

<div class="post-metadata">

**Author:** ![linux\_admin](https://avatars.discourse-cdn.com/v4/letter/l/c0e974/32.png) [@linux\_admin](https://discuss.elastic.co/u/linux_admin)\
**Post date:** [August 8, 2024, 11:18am UTC](https://discuss.elastic.co/t/elastic-mapping-issue/364426/5 "2024-08-08T11:18:44Z")

</div>

Hi @kishorkumar I have a template named **kong-index-template**  
How to update this template with the required mappings, please?

---

<div class="post-metadata">

**Author:** ![kishorkumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kishorkumar/32/132930_2.png) [@kishorkumar](https://discuss.elastic.co/u/kishorkumar)\
**Post date:** [August 9, 2024, 6:25am UTC](https://discuss.elastic.co/t/elastic-mapping-issue/364426/6 "2024-08-09T06:25:49Z")

</div>

> [@linux\_admin](#):
>
> **kong-index-template**

get all the information of index that you are using and to update follow the documentation

and then follow the documentation : [([Index templates | Elasticsearch Guide [8.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html#2fa7ded8515b32f26c54394ea598f573)](([Index templates | Elasticsearch Guide [8.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html#2fa7ded8515b32f26c54394ea598f573))

---

<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:** [September 6, 2024, 6:26am UTC](https://discuss.elastic.co/t/elastic-mapping-issue/364426/7 "2024-09-06T06:26:08Z")

</div>

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