# No type found; Types are required when writing

**URL:** <https://forum.opensearch.org/t/no-type-found-types-are-required-when-writing/6951>\
**Category:** OpenDistro\
**Created:** [September 7, 2021, 4:27pm UTC](https://forum.opensearch.org/t/no-type-found-types-are-required-when-writing/6951 "2021-09-07T16:27:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GnarlyCapricorne](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@GnarlyCapricorne](https://forum.opensearch.org/u/GnarlyCapricorne)\
**Post date:** [September 7, 2021, 4:27pm UTC](https://forum.opensearch.org/t/no-type-found-types-are-required-when-writing/6951/1 "2021-09-07T16:27:47Z")

</div>

Hello,

We use Spark to insert data to Opensearch.

We have migrate to Open Distro to Opensearch.

And now, we have this error message : No type found; Types are required when writing

It’s normal ? (disappeared since version 7). Type is re-introduce ?

`org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: No type found; Types are required when writing in ES versions 6 and below. Expected [index]/[type]`

Best Regards

Gnarly

---

<div class="post-metadata">

**Author:** ![hagayg](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hagayg](https://forum.opensearch.org/u/hagayg)\
**Post date:** [September 8, 2021, 12:38am UTC](https://forum.opensearch.org/t/no-type-found-types-are-required-when-writing/6951/2 "2021-09-08T00:38:38Z")

</div>

Seems like the spark library recognizer Opensearch as an older version of ES. Guessing it’s working well on ES\>7?

---

<div class="post-metadata">

**Author:** ![GnarlyCapricorne](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@GnarlyCapricorne](https://forum.opensearch.org/u/GnarlyCapricorne)\
**Post date:** [September 8, 2021, 12:17pm UTC](https://forum.opensearch.org/t/no-type-found-types-are-required-when-writing/6951/3 "2021-09-08T12:17:42Z")

</div>

Hello,

Yes this spark library works in ES v5, v6. And Open Distro 1.13. So i dont understand why not work with Openseacrh 1.0

We must use which spark library compatible ?

Thanks for help.

---

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [September 8, 2021, 1:39pm UTC](https://forum.opensearch.org/t/no-type-found-types-are-required-when-writing/6951/4 "2021-09-08T13:39:21Z")

</div>

@GnarlyCapricorne So, what’s happening here is that the library is specifically checking the version number and nothing else. The version number says 1.0 and _thinks_ it’s Elasticsearch 1.0.

What you can do to fix this is run in compatibility mode which returns version information like Open Distro 1.13.

You can turn it on by running this:

```auto
PUT _cluster/settings
{
  "persistent": {
    "compatibility": {
      "override_main_response_version": true
    }
  }
}

```

([more info](https://opensearch.org/docs/clients/agents-and-ingestion-tools/index/))

Also, FYI, Elasticsearch-hadoop (including the spark connector) is on the list of clients that are in the process of forking. So in the coming months a new, OpenSearch specific version will come out and this setting won’t be needed.

---

<div class="post-metadata">

**Author:** ![GnarlyCapricorne](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@GnarlyCapricorne](https://forum.opensearch.org/u/GnarlyCapricorne)\
**Post date:** [September 9, 2021, 7:55am UTC](https://forum.opensearch.org/t/no-type-found-types-are-required-when-writing/6951/5 "2021-09-09T07:55:33Z")

</div>

> [@searchymcsearchface](#):
>
> What you can do to fix this is run in compatibility mode which returns version information like Open Distro 1.13.

hello,

I will test your tip and back to you to confirm 🙂

---

<div class="post-metadata">

**Author:** ![GnarlyCapricorne](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@GnarlyCapricorne](https://forum.opensearch.org/u/GnarlyCapricorne)\
**Post date:** [September 15, 2021, 1:20pm UTC](https://forum.opensearch.org/t/no-type-found-types-are-required-when-writing/6951/6 "2021-09-15T13:20:56Z")

</div>

Nice thanks you all ! Bye
