# Elasticsearch 6.8.6 \_bulk API does not recognize parameter include\_type\_name

**URL:** https://discuss.elastic.co/t/elasticsearch-6-8-6-bulk-api-does-not-recognize-parameter-include-type-name/228872
**Category:** Elasticsearch
**Created:** [April 20, 2020, 1:32pm UTC](https://discuss.elastic.co/t/elasticsearch-6-8-6-bulk-api-does-not-recognize-parameter-include-type-name/228872 "2020-04-20T13:32:34Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![nverrill](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@nverrill](https://discuss.elastic.co/u/nverrill)
#### Post date: [April 20, 2020, 1:32pm UTC](https://discuss.elastic.co/t/elasticsearch-6-8-6-bulk-api-does-not-recognize-parameter-include-type-name/228872/1 "2020-04-20T13:32:34Z")

</div>

We have an application that can send \_bulk requests to elasticsearch(I cannot modify what it sends), but is failing because the type is missing and it appears that [include\_type\_name] is not supported by the \_bulk API. We are currently on Elasticsearch 6.8.6.

Is this intended behavior?

Request:

```auto
POST /_bulk
{ "index" : { "_index" : "test", "_id" : "1" } }
{ "field1" : "value1" }

```

Response:

```auto
{
  "error": {
    "root_cause": [
    {
      "type": "action_request_validation_exception",
      "reason": "Validation Failed: 1: type is missing;"
    }
  ],
    "type": "action_request_validation_exception",
    "reason": "Validation Failed: 1: type is missing;"
  },
  "status": 400
}

```

Request:

```auto
 POST /_bulk?include_type_name=false
 { "index" : { "_index" : "test", "_id" : "1" } }
 { "field1" : "value1" }

```

Response:

```auto
{
  "error": {
    "root_cause": [
  {
    "type": "illegal_argument_exception",
    "reason": "request [/_bulk] contains unrecognized parameter: [include_type_name]"
  }
    ],
    "type": "illegal_argument_exception",
    "reason": "request [/_bulk] contains unrecognized parameter: [include_type_name]"
  },
  "status": 400
}

```

---

<div class="post-metadata">

### Author: ![Alsheh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alsheh/32/36799_2.png) [@Alsheh](https://discuss.elastic.co/u/Alsheh)
#### Post date: [April 20, 2020, 1:53pm UTC](https://discuss.elastic.co/t/elasticsearch-6-8-6-bulk-api-does-not-recognize-parameter-include-type-name/228872/2 "2020-04-20T13:53:11Z")

</div>

`_type` is missing or upgrade to Elasticsearch `7.x ` and you don't have to specify `_type`:

```auto
POST /_bulk
{ "index" : { "_index" : "test", "_type" : "_doc", "_id" : "1" } }
{ "field1" : "value1" 

```

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 20, 2020, 2:27pm UTC](https://discuss.elastic.co/t/elasticsearch-6-8-6-bulk-api-does-not-recognize-parameter-include-type-name/228872/3 "2020-04-20T14:27:52Z")

</div>

Are you using the Java client 6.8 on an older version of elasticsearch by any chance?  
Or a 7.x Java client?

Could you describe a bit more?

---

<div class="post-metadata">

### Author: ![nverrill](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@nverrill](https://discuss.elastic.co/u/nverrill)
#### Post date: [April 20, 2020, 10:26pm UTC](https://discuss.elastic.co/t/elasticsearch-6-8-6-bulk-api-does-not-recognize-parameter-include-type-name/228872/4 "2020-04-20T22:26:12Z")

</div>

I'm aware that type is deprecated in 7.x.  
I am following recommendations for upgrade path by going from 6.3.2, to 6.8.6(current), and then will move to 7.x when I've transitioned some settings.  
[https://www.elastic.co/blog/moving-from-types-to-typeless-apis-in-elasticsearch-7-0](https://www.elastic.co/blog/moving-from-types-to-typeless-apis-in-elasticsearch-7-0)  
In 6.8.6 however there is a parameter that can be used to ease transition called "include\_type\_name".

My question is, why isn't the "include\_type\_name" recognized as parameter for the bulk index API, as it is for the single document API? Or is it supposed to be working and there is a bug?

For example, single doc request:

```auto
PUT /test?include_type_name=false

```

Response:

```auto
{
  "acknowledged" : true,
  "shards_acknowledged" : true,
  "index" : "test"
}

```

---

<div class="post-metadata">

### Author: ![nverrill](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@nverrill](https://discuss.elastic.co/u/nverrill)
#### Post date: [April 20, 2020, 10:27pm UTC](https://discuss.elastic.co/t/elasticsearch-6-8-6-bulk-api-does-not-recognize-parameter-include-type-name/228872/5 "2020-04-20T22:27:20Z")

</div>

I am running these commands from 6.8.6 Kibana dev console to 6.8.6 Elasticsearch.

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [April 21, 2020, 12:06pm UTC](https://discuss.elastic.co/t/elasticsearch-6-8-6-bulk-api-does-not-recognize-parameter-include-type-name/228872/6 "2020-04-21T12:06:55Z")

</div>

I don't think either the Bulk API or the single-document Index API accept the `?include_type_name` parameter in any released versions, and this is deliberate. `PUT /test` is the create index API and that _does_ accept this parameter in 6.8 and 7.x, but that's nothing to do with indexing documents.

---

<div class="post-metadata">

### Author: ![nverrill](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@nverrill](https://discuss.elastic.co/u/nverrill)
#### Post date: [April 24, 2020, 3:26pm UTC](https://discuss.elastic.co/t/elasticsearch-6-8-6-bulk-api-does-not-recognize-parameter-include-type-name/228872/7 "2020-04-24T15:26:25Z")

</div>

Ah yes, you are correct. I was clearly getting the two confused. Thanks for clearing that up.

---

<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: [May 22, 2020, 3:32pm UTC](https://discuss.elastic.co/t/elasticsearch-6-8-6-bulk-api-does-not-recognize-parameter-include-type-name/228872/8 "2020-05-22T15:32:20Z")

</div>

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