# ES/Kibana 5.6: why this request doesn't work?

**URL:** <https://discuss.elastic.co/t/es-kibana-5-6-why-this-request-doesnt-work/216224>\
**Category:** Kibana\
**Created:** [January 23, 2020, 11:18am UTC](https://discuss.elastic.co/t/es-kibana-5-6-why-this-request-doesnt-work/216224 "2020-01-23T11:18:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolasduminil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nicolasduminil/32/132360_2.png) [@nicolasduminil](https://discuss.elastic.co/u/nicolasduminil)\
**Post date:** [January 23, 2020, 11:18am UTC](https://discuss.elastic.co/t/es-kibana-5-6-why-this-request-doesnt-work/216224/1 "2020-01-23T11:18:47Z")

</div>

Hello,

In the Kibana 5.6 console, development tools, I'm doing the following request:

PUT test/\_mapping  
{  
"properties" : {  
"id" : {"type" : "keyword"},  
"date" : {"type" : "date"},  
"customer\_id" : {"type" : "keyword"},  
"sent" : {"type" : "boolean"},  
"name" : {"type" : "keyword"},  
"quantity" : {"type" : "integer"},  
"vat" : {"type" : "double", "index":"false"}  
}  
}

And here is the response:

{  
"error": {  
"root\_cause": [  
{  
"type": "action\_request\_validation\_exception",  
"reason": "Validation Failed: 1: mapping type is missing;"  
}  
],  
"type": "action\_request\_validation\_exception",  
"reason": "Validation Failed: 1: mapping type is missing;"  
},  
"status": 400  
}

However, it's supposed to work as I'm using the samples in the "ElasticSearch Cookbook 4th Edition" by Alberto Paro, publshed at Packt in march 2019.  
Could anyone shad some light here please ?  
Many thanks in advance.  
Kind regards,  
Nicolas

---

<div class="post-metadata">

**Author:** ![Fabio-sama](https://avatars.discourse-cdn.com/v4/letter/f/b9e5f3/32.png) [@Fabio-sama](https://discuss.elastic.co/u/Fabio-sama)\
**Post date:** [January 23, 2020, 11:32am UTC](https://discuss.elastic.co/t/es-kibana-5-6-why-this-request-doesnt-work/216224/2 "2020-01-23T11:32:26Z")

</div>

The problem is the one highlighted in the error message. You're missing the type of the mapping.

In older versions of elasticsearch the type of mapping was mandatory and required.

So you can either do something like:

```
PUT test/_mapping/your_type_of_mapping
{
  "properties" : {
    "id" : {"type" : "keyword"},
    "date" : {"type" : "date"},
    "customer_id" : {"type" : "keyword"},
    "sent" : {"type" : "boolean"},
    "name" : {"type" : "keyword"},
    "quantity" : {"type" : "integer"},
    "vat" : {"type" : "double", "index":"false"}
  }
}

```

Or you do something like

```
PUT test 
{
  "mappings": {
    "your_type_of_mapping": {
      "properties" : {
        "id" : {"type" : "keyword"},
        "date" : {"type" : "date"},
        "customer_id" : {"type" : "keyword"},
        "sent" : {"type" : "boolean"},
        "name" : {"type" : "keyword"},
        "quantity" : {"type" : "integer"},
        "vat" : {"type" : "double", "index":"false"}
      }
    }
  }
}

```

In both cases you have to specify the type of mapping you're trying to apply.

I personally don't know the book but maybe it is written for a newer version of the stack (\>= 7.0 possibly).

---

<div class="post-metadata">

**Author:** ![nicolasduminil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nicolasduminil/32/132360_2.png) [@nicolasduminil](https://discuss.elastic.co/u/nicolasduminil)\
**Post date:** [January 23, 2020, 1:15pm UTC](https://discuss.elastic.co/t/es-kibana-5-6-why-this-request-doesnt-work/216224/3 "2020-01-23T13:15:48Z")

</div>

Hello, thanks for replying. I've upgraded to ELK 7.2.5 and the given syntax is working.  
Kind regards,  
Nicolas

---

<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:** [February 20, 2020, 1:15pm UTC](https://discuss.elastic.co/t/es-kibana-5-6-why-this-request-doesnt-work/216224/4 "2020-02-20T13:15:59Z")

</div>

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