# Elasticsearch 7 mappping on Elasticsearch 6

**URL:** <https://discuss.elastic.co/t/elasticsearch-7-mappping-on-elasticsearch-6/203681>\
**Category:** Elasticsearch\
**Created:** [October 15, 2019, 3:10pm UTC](https://discuss.elastic.co/t/elasticsearch-7-mappping-on-elasticsearch-6/203681 "2019-10-15T15:10:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavolloffay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavolloffay/32/29939_2.png) [@pavolloffay](https://discuss.elastic.co/u/pavolloffay)\
**Post date:** [October 15, 2019, 3:10pm UTC](https://discuss.elastic.co/t/elasticsearch-7-mappping-on-elasticsearch-6/203681/1 "2019-10-15T15:10:25Z")

</div>

Hello,

is it possible to use Elasticsearch 7 mapping (with no types) on any version of Elasticsearch 6?  
For instance this mapping:

```auto
{
  "mappings":{
    "properties":{
      "serviceName":{
        "type":"keyword",
        "ignore_above":256
      },
      "operationName":{
        "type":"keyword",
        "ignore_above":256
      }
    }
  }
}

```

Another question: Will the mapping with `_doc` type work on any Elasticsearch 8 version? If it would work it would allow us to use new mapping for ES 8 and wait until old indices with `_doc` TTLout.

```auto
{
  "mappings":{
    "_doc": {
      "properties":{
        "serviceName":{
          "type":"keyword",
          "ignore_above":256
        },
        "operationName":{
          "type":"keyword",
          "ignore_above":256
        }
      }
    }
  }
}

```

---

<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:** [October 15, 2019, 3:35pm UTC](https://discuss.elastic.co/t/elasticsearch-7-mappping-on-elasticsearch-6/203681/2 "2019-10-15T15:35:04Z")

</div>

Welcome!

I think that in 6.x you can use the `include_type_name=false` option to have a similar behavior as you would find with 7.x.

Have a look at [https://www.elastic.co/guide/en/elasticsearch/reference/6.8/removal-of-types.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/removal-of-types.html).

---

<div class="post-metadata">

**Author:** ![pavolloffay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavolloffay/32/29939_2.png) [@pavolloffay](https://discuss.elastic.co/u/pavolloffay)\
**Post date:** [October 15, 2019, 4:16pm UTC](https://discuss.elastic.co/t/elasticsearch-7-mappping-on-elasticsearch-6/203681/3 "2019-10-15T16:16:58Z")

</div>

Thanks for quick reponse. Creating the template with `include_type_name=false` worked well.

However now there is problem with writing the data. We use bulk API to store data. Is there a way to use typeless API with ES 6.8 and bulk API?

[Removal of mapping types | Elasticsearch Guide [master] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/master/removal-of-types.html#_mixed_version_clusters) says

> Typeless document APIs such as `bulk` and `update` are only available as of 7.0, and will not work with 6.8 nodes. This also holds true for the typeless versions of queries that perform document lookups, such as `terms` .

---

<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:** [October 15, 2019, 4:36pm UTC](https://discuss.elastic.co/t/elasticsearch-7-mappping-on-elasticsearch-6/203681/4 "2019-10-15T16:36:13Z")

</div>

I honestly don't know.

Can't you upgrade your cluster to 7.4?

---

<div class="post-metadata">

**Author:** ![pavolloffay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavolloffay/32/29939_2.png) [@pavolloffay](https://discuss.elastic.co/u/pavolloffay)\
**Post date:** [October 16, 2019, 7:56am UTC](https://discuss.elastic.co/t/elasticsearch-7-mappping-on-elasticsearch-6/203681/5 "2019-10-16T07:56:08Z")

</div>

Can you ask around to find out?

I am still interested to know whether the following mapping will work with Elasticsearch 8.

```auto
{
  "mappings":{
    "_doc": {
      "properties":{
        "serviceName":{
          "type":"keyword",
          "ignore_above":256
        },
        "operationName":{
          "type":"keyword",
          "ignore_above":256
        }
      }
    }
  }
}

```

We are working on OSS project Jaeger which uses Elasticsearch as backend storage. Our goal is to provide wide compatibility with Elasticsearch versions.

---

<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:** [October 18, 2019, 3:57pm UTC](https://discuss.elastic.co/t/elasticsearch-7-mappping-on-elasticsearch-6/203681/6 "2019-10-18T15:57:52Z")

</div>

In my personal project, I had to implement multiple ways to support different major versions.

> I am still interested to know whether the following mapping will work with Elasticsearch 8.

Probably not. It will need to be something like:

```auto
{
  "mappings":{
      "properties":{
        "serviceName":{
          "type":"keyword",
          "ignore_above":256
        },
        "operationName":{
          "type":"keyword",
          "ignore_above":256
        }
      }
    }
}

```

---

<div class="post-metadata">

**Author:** ![pavolloffay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavolloffay/32/29939_2.png) [@pavolloffay](https://discuss.elastic.co/u/pavolloffay)\
**Post date:** [November 4, 2019, 12:49pm UTC](https://discuss.elastic.co/t/elasticsearch-7-mappping-on-elasticsearch-6/203681/7 "2019-11-04T12:49:02Z")

</div>

Thanks for the clarification @dadoonet!

I didn't understand well how the Elasticsearch upgrades work in general. Please double check if I got it right now.

Elasticsearch node defines:

```auto
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"

```

The wire compatibility defines the minimal version this node can communicate with. The index compatibility defines the minimal version this node can read data from. In this case this node (ES7) can read indices created by 6.x and can be deployed in a mixed cluster with ES 6.8 nodes.

ES6 can read and write to indices created by ES5 and ES7 can write and read from indices created by ES6. Therefore users can upgrade from ES6 to ES7 without any migration/reindex. If they are using ES5 and want to upgrade to ES7 they have to go through ES6 and wait until old indices TTLout or explicitly reindex.

In our case we want to provide compatibility with ES 5,6,7 so we have to use different mappings for different versions, however users can upgrade ES version without any additional work as described above.

- ES 5, 6 use typed indices:

```auto
  "mappings":{
    "dynamic_templates":[
      {
        "span_tags_map":{
          "mapping":{
            "type":"keyword",
            "ignore_above":256
          },
          "path_match":"tag.*"
        }
      },
    "properties":{
      "serviceName":{
        "type":"keyword",
        "ignore_above":256
      },
      "operationName":{
        "type":"keyword",
        "ignore_above":256
      }
    }
  }

```

- S 7 use typeless mappings:

```auto
{
  "mappings":{
    "properties":{
      "serviceName":{
        "type":"keyword",
        "ignore_above":256
      },
      "operationName":{
        "type":"keyword",
        "ignore_above":256
      }
    }
  }
}

```

---

<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:** [November 5, 2019, 2:30pm UTC](https://discuss.elastic.co/t/elasticsearch-7-mappping-on-elasticsearch-6/203681/8 "2019-11-05T14:30:44Z")

</div>

The problem is the API.

Even though you can start a 7.x node on 6.x data path, you can not send 6.x API requests to a 7.x node.

So in short, if you have a cluster running a 7.x version, you need to comply with the 7.x API.

---

<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:** [December 3, 2019, 2:30pm UTC](https://discuss.elastic.co/t/elasticsearch-7-mappping-on-elasticsearch-6/203681/9 "2019-12-03T14:30:50Z")

</div>

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