0

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 Answer 1

1

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"
            }
          }
        }
      }
    }
  }
}
Sign up to request clarification or add additional context in comments.

14 Comments

Thanks for your inputs,i was trying to make abc as mapping type in the index but not sure why it is not picking it,can u xplain why it is not picking as i’m following the same standards for index creation
as it stands, abc is a field name, not the mapping type name.
If i remove type :nested in my question ,abc is considered as mapping type ,if i include it is giving the above error
Because nested only works for fields, not types. Not sure what you want to do. It's working the same way in ES7
Thanks for the info ,really appreciate it and can u pls tell me whether can we create multiple mapping types under one index,if yes. Can u give me an example using same code.i tried it but couldn’t do it.thanks in advance
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.