# Spark-ES saveToES without type

**URL:** <https://discuss.elastic.co/t/spark-es-savetoes-without-type/123622>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [March 12, 2018, 7:36pm UTC](https://discuss.elastic.co/t/spark-es-savetoes-without-type/123622 "2018-03-12T19:36:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![skylerl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skylerl/32/22991_2.png) [@skylerl](https://discuss.elastic.co/u/skylerl)\
**Post date:** [March 12, 2018, 7:36pm UTC](https://discuss.elastic.co/t/spark-es-savetoes-without-type/123622/1 "2018-03-12T19:36:47Z")

</div>

Hi everyone,

We're trying to ingest a DataFrame to Elasticsearch using the Elasticsearch Spark library. In Elasticsearch 6.x, types are now gone. So, to make our data ingestion more compliant, we've been trying to ingest our data without an index type.

We're calling the `saveToES` method like this:

```auto
dataFrame.saveToEs("indexname", config.toMap)

```

Then we get the following error when this method is called:

```auto
Caused by: org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: No type found; Types are required when writing. Expected [index]/[type], but got [indexname]

```

We're using the following dependencies in SBT:

```auto
"org.elasticsearch" % "elasticsearch-spark-20_2.11" % "6.2.2" exclude("org.scalatest", "scalatest_2.11"),
"org.elasticsearch.client" % "x-pack-transport" % "6.2.2",
"org.elasticsearch.client" % "transport" % "6.2.2"

```

We're also using Elasticsearch 6.2.2.

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [March 16, 2018, 4:35pm UTC](https://discuss.elastic.co/t/spark-es-savetoes-without-type/123622/2 "2018-03-16T16:35:51Z")

</div>

Until types are fully removed (in Elasticsearch 7.0), all indices still have one type - either specified by the user, either a default one (`doc`).  
You can double check this by looking at your mappings.

---

<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:** [April 13, 2018, 4:35pm UTC](https://discuss.elastic.co/t/spark-es-savetoes-without-type/123622/3 "2018-04-13T16:35:57Z")

</div>

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