# How to change data mapping to include 'suggest type' for an existing index

**URL:** <https://discuss.elastic.co/t/how-to-change-data-mapping-to-include-suggest-type-for-an-existing-index/261930>\
**Category:** Elasticsearch\
**Created:** [January 22, 2021, 3:16pm UTC](https://discuss.elastic.co/t/how-to-change-data-mapping-to-include-suggest-type-for-an-existing-index/261930 "2021-01-22T15:16:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nadyahmed123](https://avatars.discourse-cdn.com/v4/letter/n/85f322/32.png) [@nadyahmed123](https://discuss.elastic.co/u/nadyahmed123)\
**Post date:** [January 22, 2021, 3:16pm UTC](https://discuss.elastic.co/t/how-to-change-data-mapping-to-include-suggest-type-for-an-existing-index/261930/1 "2021-01-22T15:16:29Z")

</div>

Hi,

I am new to ES. I have already created an index `index1` which has some data. I need to implement autocomplete for one of the field, so for that I need to have the `suggest` type added in mappings (From what I read... do let me know if there is an alternative). But how do I add the suggest type for an existing index without re-indexing. The mapping for the field `company_id` :  
`GET /testindex/_mapping/field/company_id`

```auto
 {
  "testindex" : {
    "mappings" : {
      "company_id" : {
        "full_name" : "company_id",
        "mapping" : {
          "company_id" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 27, 2021, 8:21am UTC](https://discuss.elastic.co/t/how-to-change-data-mapping-to-include-suggest-type-for-an-existing-index/261930/2 "2021-01-27T08:21:52Z")

</div>

In order to change mappings like that you do need to reindex.

---

<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:** [February 24, 2021, 8:21am UTC](https://discuss.elastic.co/t/how-to-change-data-mapping-to-include-suggest-type-for-an-existing-index/261930/3 "2021-02-24T08:21:56Z")

</div>

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