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

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

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

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

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