1

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

Harry
  • 3,072
  • 6
  • 43
  • 100
  • I believe this would be a re-work, unless the `Ingest/Reindex API` in ES version 8, comes with some form of [remote-reindex](https://www.elastic.co/guide/en/elasticsearch/reference/current/reindex-upgrade-remote.html) 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. – Kamal Kunjapur Jun 11 '20 at 08:07
  • Also note that, I haven't seen anything what I mentioned in their [reindex breaking changes section](https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-8.0.html#breaking_80_reindex_changes). You may want to keep an eye on this and revisit once ES version 8 comes out. – Kamal Kunjapur Jun 11 '20 at 08:08
  • 1
    @OpsterESNinja-Kamal good to see after loooong time :D – Amit Jun 11 '20 at 09:47
  • @OpsterESNinja-Kamal, Thanks for the point, But what is the advantage of giving the type as _doc in the prepareIndex ? https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-docs-index.html – Harry Jun 11 '20 at 16:04
  • @Harry From this [link](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html) 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` – Kamal Kunjapur Jun 11 '20 at 16:27
  • @OpsterESNinja-Kamal This link is super useful – Harry Jun 11 '20 at 22:40
  • You could post this as answer, I will approve it – Harry Jun 11 '20 at 22:40
  • @Harry I've copied the comments into answer section. Once you approve of it, I will go ahead and delete the comments. Feel free to ask if you have any more queries. – Kamal Kunjapur Jun 12 '20 at 04:24

1 Answers1

1

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!

Kamal Kunjapur
  • 8,547
  • 2
  • 22
  • 32
  • 1
    Could you let me know this one pls : https://stackoverflow.com/questions/62334781/query-across-multiple-index-in-the-elasticsearch-version-7-7 – Harry Jun 12 '20 at 12:50
  • sure, please give me sometime, I will check and let you know!! Also note that transport module has been deprecated as mentioned [here](https://www.elastic.co/guide/en/cloud/current/ec-java-transport.html). You may want to check High Level Rest API for this. I will check and update you as soon as I can. – Kamal Kunjapur Jun 12 '20 at 12:51
  • To migrate to Rest will be a huge change for us, I checked the documentation 7.8 has EOL by next November 2021 so it won't be a problem for us. But I want to know this for supporting existing business use case : https://stackoverflow.com/questions/62334781/query-across-multiple-index-in-the-elasticsearch-version-7-7 – Harry Jun 12 '20 at 13:51
  • Could you please check this : https://stackoverflow.com/questions/62671455/elasticsearch-put-role-api – Harry Jul 01 '20 at 07:19