# Write RDD/DF to Index with no type

**URL:** <https://discuss.elastic.co/t/write-rdd-df-to-index-with-no-type/103728>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [October 12, 2017, 1:14pm UTC](https://discuss.elastic.co/t/write-rdd-df-to-index-with-no-type/103728 "2017-10-12T13:14:52Z")\
**Posts on this page:** 2\
**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:** [October 12, 2017, 1:14pm UTC](https://discuss.elastic.co/t/write-rdd-df-to-index-with-no-type/103728/1 "2017-10-12T13:14:52Z")

</div>

**EDIT** : Whoops, did not realize the single type indexes were ES 5.6!

Hi there,

We're trying to write an RDD (with Spark Streaming) to Elasticsearch with just an index and no type, however we keep getting:

`org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: invalid pattern given my_index/`

However, when I add a type, it works fine. I am calling `saveToEs` like this:

`EsSparkStreaming.saveToEs(directStream, "my_index/my_type", Map("es.nodes"->"localhost", "es.index.auto.create" -> "true"))`

From what I can remember, regular Spark batch jobs can do just an index but Streaming doesn't seem to support that. This is my dependency in my POM in case it matters:

```
<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch-spark-20_2.11</artifactId>
    <version>5.5.0</version>
</dependency>

```

Thanks in advance!

---

<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:** [November 9, 2017, 1:15pm UTC](https://discuss.elastic.co/t/write-rdd-df-to-index-with-no-type/103728/2 "2017-11-09T13:15:28Z")

</div>

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