# Mapping types are being removed, so why am I still expected to provide type information in bulk requests?

**URL:** <https://discuss.elastic.co/t/mapping-types-are-being-removed-so-why-am-i-still-expected-to-provide-type-information-in-bulk-requests/179031>\
**Category:** Elasticsearch\
**Created:** [April 30, 2019, 7:38am UTC](https://discuss.elastic.co/t/mapping-types-are-being-removed-so-why-am-i-still-expected-to-provide-type-information-in-bulk-requests/179031 "2019-04-30T07:38:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [April 30, 2019, 7:38am UTC](https://discuss.elastic.co/t/mapping-types-are-being-removed-so-why-am-i-still-expected-to-provide-type-information-in-bulk-requests/179031/1 "2019-04-30T07:38:28Z")

</div>

I use ElasticSearch 6.7.0.

According to ElasticSearch documentation, [mapping types are being removed](https://www.elastic.co/guide/en/elasticsearch/reference/master/removal-of-types.html).

I want to create lots of documents in a single bulk request. My JSON document looks something like this:

```auto
"index":{"_id":"1"}
"info":"1"

```

When I tried sending the bulk request, I saw the following error:

```auto
"type" : "action_request_validation_exception",
"reason" : "Validation Failed: 1: type is missing;"

```

I discovered that someone else [had already encountered the same issue](https://discuss.elastic.co/t/validation-failed-because-of-missing-type-with-bulk-api/118465). The accepted answer mentioned that the type information must be present either in the URL, or inside the JSON document itself, e.g.

```auto
POST /your_index/your_type/_bulk
{"index":{"_id":"1"}}
{"info":"1"}

```

or

```auto
POST /_bulk
{"index":{"_index": "your_index", "_type": "your_type", "_id":"1"}}
{"info":"1"}

```

Why is this still necessary, even when mapping types are being removed? Is there any way I can send a bulk request without specifying the mapping type?

---

<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 30, 2019, 7:53am UTC](https://discuss.elastic.co/t/mapping-types-are-being-removed-so-why-am-i-still-expected-to-provide-type-information-in-bulk-requests/179031/2 "2019-04-30T07:53:25Z")

</div>

You must specify the type in the bulk API in 6.7.  
It's deprecated in 7.0 for the bulk API.

See details of the schedule here: [https://www.elastic.co/guide/en/elasticsearch/reference/6.7/removal-of-types.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/removal-of-types.html)

---

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [April 30, 2019, 8:00am UTC](https://discuss.elastic.co/t/mapping-types-are-being-removed-so-why-am-i-still-expected-to-provide-type-information-in-bulk-requests/179031/3 "2019-04-30T08:00:03Z")

</div>

Thank you for your prompt reply. I shall download ElasticSearch 7.0 now and give it a try. 🙂

---

<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 28, 2019, 8:00am UTC](https://discuss.elastic.co/t/mapping-types-are-being-removed-so-why-am-i-still-expected-to-provide-type-information-in-bulk-requests/179031/4 "2019-05-28T08:00:22Z")

</div>

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