0
votes

I’m trying to create an index in elasticsearch using kibana dev tools but i’m facing the following errors.please suggest me on this.

PUT xyz
{
“mappings”:{
“abc”:{
     “type”:”nested”,
     “properties”:{
         “name”:{“type”:”keyword”}
     }
  }
 }
}

Error: { type:”mapper_parsing_exception”, reason:”Root mapping definition has unsupported parameters:[type:nested] }

It was working fine elasticsearch 7 but not in version 6.4.2

1

1 Answers

1
votes

This is because in ES 7, mapping types have been removed. If you want to make this work on ES 6.4.2, you need to change your query to include a mapping type name, like this:

PUT xyz
{
  "mappings": {
    "type_name": {                      <---- add this
      "properties": {                   <---- and this
        "abc": {
          "type": "nested",
          "properties": {
            "name": {
              "type": "keyword"
            }
          }
        }
      }
    }
  }
}