Search code examples
elasticsearchelasticsearch-5backwards-compatibilityelasticsearch-dslelasticsearch-7

Usage of _type in the ElasticSearch from 5.5 to 7.7


We are migrating from 5.5 to 7.7 where there will be only one "_type" for the "index" In 5.5, there will be multiple "_type" for the "index", we are changing our data structure as per the current structure in the elastic search 7.7 which means each index will have one type.

Later this year, We are upgrading the elastic search server from 7.7 to 8,
Also we are using the transport client using Java which is the EOL in the 7.8 and will move to Rest client on the client-side.

Currently, we have single "_type" mapped to "index" in version 7.7, I see as per the documentation it will become typeless in version 8. so what is the best way to add _type OR Is there a way to remove type usage in 7.7 so that we don't need to make any changes in the 8 version in the elastic search server side.

Thanks,
Harry


Solution

  • I believe this would be a re-work, unless the Ingest/Reindex API in ES version 8, comes with some form of remote-reindex mechanism which would allow the documents to be ingested from version 7 to 8 by taking into consideration to adjust _doc accordingly, you may have to re-ingest the documents from source/ingestion layer by re-creating indexes and mapping and similarly making end point changes to index documents from the service/ingestion tool.

    Also note that, I haven't seen anything what I mentioned in their reindex breaking changes section. You may want to keep an eye on this and revisit once ES version 8 comes out.

    Note that from this link it states this

    Note that in 7.0, _doc is a permanent part of the path, and represents the endpoint name rather than the document type

    Hope this helps!