Error on disable data_detection

I'm trying to disable data_detection via curl.
I delete the shard

curl -s -H 'Content-Type: application/json' -X DELETE 'http://localhost:9200/video?pretty'

{
  "acknowledged" : true
}

then

curl -H 'Content-Type: application/json' -X PUT 'http://localhost:9200/video?pretty' -d'{ "mappings": { "date_detection": false } }'

{
  "error" : {
    "root_cause" : [
      {
        "type" : "class_cast_exception",
        "reason" : "class java.lang.Boolean cannot be cast to class java.util.Map (java.lang.Boolean and java.util.Map are in module java.base of loader 'bootstrap')"
      }
    ],
    "type" : "class_cast_exception",
    "reason" : "class java.lang.Boolean cannot be cast to class java.util.Map (java.lang.Boolean and java.util.Map are in module java.base of loader 'bootstrap')"
  },
  "status" : 500
}

I've a field "meta" (array of metatags) but sometime a metatag is a date and

["error"]=>
array(2) {
  ["type"]=>
  string(26) "illegal_argument_exception"
  ["reason"]=>
  string(72) "mapper [meta] of different type, current_type [text], merged_type [date]"
}

so I think the solution is to disable date_detection.
correct? :thinking:

After you delete the index can you check if it has been recreated? Because that is what is looking like what happened, and it's mapping the date field automatically.

after delete it's not recreated.
checked with

curl -s -H 'Content-Type: application/json' 'http://localhost:9200/video?pretty'

return status 404

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