Learning ES and Mapper Parsing Exception

Hi to all,

I'm learning ES. I have ES-7.8 in a docker container and started to play around with it. I have created mappings and loaded data already. Now, I'm following a course and I'm trying to create a mapping before loading the data. My curl command is as follow...

    curl -H "Content-Type: application/json" -XPUT localhost:9200/movies -d '
    {
      "mappings": {
        "movie": {
          "properties": {
            "year": {
              "type": "date"
            }
          }
        }
      }
    }'

This is the error I'm getting back

    {
      "error":{
        "root_cause":[
          {
            "type":"mapper_parsing_exception",
            "reason":"Root mapping definition has unsupported parameters:  [movie : {properties={year={type=date}}}]"
          }
        ],
        "type":"mapper_parsing_exception",
        "reason":"Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [movie : {properties={year={type=date}}}]",
        "caused_by":{
          "type":"mapper_parsing_exception",
          "reason":"Root mapping definition has unsupported parameters:  [movie : {properties={year={type=date}}}]"
        }
      },
      "status":400
    }

I there a way to troubleshot this or anyone can spot what is wrong in the command?

Try

curl -H "Content-Type: application/json" -XPUT localhost:9200/movies -d '
{
  "mappings": {
      "properties": {
        "year": {
          "type": "date"
        }
      }
  }
}'

That worked. But, How I can modify properties per type. Lets say I have two types in the movies index, movie and actor... how can I modify same name property in one type and not in another type?

I think this answers my question...
Removal of Types

1 Like