# Es 6.x not support multi types in index, but elasticsearch-hadoop docs not update

**URL:** <https://discuss.elastic.co/t/es-6-x-not-support-multi-types-in-index-but-elasticsearch-hadoop-docs-not-update/116842>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [January 24, 2018, 10:05am UTC](https://discuss.elastic.co/t/es-6-x-not-support-multi-types-in-index-but-elasticsearch-hadoop-docs-not-update/116842 "2018-01-24T10:05:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldcodeoberyn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oldcodeoberyn/32/24800_2.png) [@oldcodeoberyn](https://discuss.elastic.co/u/oldcodeoberyn)\
**Post date:** [January 24, 2018, 10:05am UTC](https://discuss.elastic.co/t/es-6-x-not-support-multi-types-in-index-but-elasticsearch-hadoop-docs-not-update/116842/1 "2018-01-24T10:05:57Z")

</div>

in this guide:  
[https://www.elastic.co/guide/en/elasticsearch/hadoop/current/spark.html](https://www.elastic.co/guide/en/elasticsearch/hadoop/current/spark.html)

it recommend user to use es 6.x version which not support multi type, but still guide user to set multi-type in one index

```auto
val game = Map("media_type"->"game","title" -> "FF VI","year" -> "1994")
val book = Map("media_type" -> "book","title" -> "Harry Potter","year" -> "2010")
val cd = Map("media_type" -> "music","title" -> "Surfing With The Alien")

sc.makeRDD(Seq(game, book, cd)).saveToEs("my-collection/{media_type}")  

```

of cause, above code will fail:

```auto
rg.apache.spark.util.TaskCompletionListenerException: Found unrecoverable error [127.0.0.1:9200] returned Bad Request(400) - Rejecting mapping update to [my-collection] as the final mapping would have more than 1 type: [game, book]; Bailing out..
	at org.apache.spark.TaskContextImpl.invokeListeners(TaskContextImpl.scala:138)
	at org.apache.spark.TaskContextImpl.markTaskCompleted(TaskContextImpl.scala:116)
	at org.apache.spark.scheduler.Task.run(Task.scala:124)

```

---

<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:** [January 24, 2018, 10:22am UTC](https://discuss.elastic.co/t/es-6-x-not-support-multi-types-in-index-but-elasticsearch-hadoop-docs-not-update/116842/2 "2018-01-24T10:22:29Z")

</div>

I moved your question to #elasticsearch-and-hadoop.

I agree. It's a bug (documentation bug). Would you like to open an issue in [https://github.com/elastic/elasticsearch-hadoop/](https://github.com/elastic/elasticsearch-hadoop/) project?

I think you should call:

```auto
sc.makeRDD(Seq(game, book, cd)).saveToEs("my-collection-{media_type}/doc")

```

---

<div class="post-metadata">

**Author:** ![james.baiera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james.baiera/32/10209_2.png) [@james.baiera](https://discuss.elastic.co/u/james.baiera)\
**Post date:** [January 24, 2018, 2:54pm UTC](https://discuss.elastic.co/t/es-6-x-not-support-multi-types-in-index-but-elasticsearch-hadoop-docs-not-update/116842/3 "2018-01-24T14:54:32Z")

</div>

Agreed, we'll update the docs.

---

<div class="post-metadata">

**Author:** ![oldcodeoberyn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oldcodeoberyn/32/24800_2.png) [@oldcodeoberyn](https://discuss.elastic.co/u/oldcodeoberyn)\
**Post date:** [January 25, 2018, 12:58am UTC](https://discuss.elastic.co/t/es-6-x-not-support-multi-types-in-index-but-elasticsearch-hadoop-docs-not-update/116842/4 "2018-01-25T00:58:46Z")

</div>

I have open an issue #1100 on [https://github.com/elastic/elasticsearch-hadoop/](https://github.com/elastic/elasticsearch-hadoop/)

---

<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 8, 2018, 12:59am UTC](https://discuss.elastic.co/t/es-6-x-not-support-multi-types-in-index-but-elasticsearch-hadoop-docs-not-update/116842/5 "2018-02-08T00:59:13Z")

</div>

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