# Error on disable data\_detection

**URL:** <https://discuss.elastic.co/t/error-on-disable-data-detection/324265>\
**Category:** Elasticsearch\
**Created:** [January 30, 2023, 6:56pm UTC](https://discuss.elastic.co/t/error-on-disable-data-detection/324265 "2023-01-30T18:56:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sphawk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sphawk/32/76990_2.png) [@sphawk](https://discuss.elastic.co/u/sphawk)\
**Post date:** [January 30, 2023, 6:56pm UTC](https://discuss.elastic.co/t/error-on-disable-data-detection/324265/1 "2023-01-30T18:56:21Z")

</div>

I'm trying to disable data\_detection via curl.  
I delete the shard

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

{
  "acknowledged" : true
}

```

then

```auto
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

```auto
["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? 🤔

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 30, 2023, 11:59pm UTC](https://discuss.elastic.co/t/error-on-disable-data-detection/324265/2 "2023-01-30T23:59:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sphawk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sphawk/32/76990_2.png) [@sphawk](https://discuss.elastic.co/u/sphawk)\
**Post date:** [February 1, 2023, 7:44am UTC](https://discuss.elastic.co/t/error-on-disable-data-detection/324265/3 "2023-02-01T07:44:27Z")

</div>

after delete it's not recreated.  
checked with

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

```

return status 404

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 1, 2023, 7:45am UTC](https://discuss.elastic.co/t/error-on-disable-data-detection/324265/4 "2023-03-01T07:45:14Z")

</div>

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