elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.83k stars 24.71k forks source link

[Docs] Change example for restore operation #97231

Open ruflin opened 1 year ago

ruflin commented 1 year ago

The documentation page around restore and rename has the following example inside:

POST _snapshot/my_repository/my_snapshot_2099.05.06/_restore
{
  "indices": "my-index,logs-my_app-default",
  "rename_pattern": "(.+)",
  "rename_replacement": "restored-$1"
}

I want to use this Github issue to discuss if we should adjust this example or it is what we expect.

The a sample data stream the data stream logs-my_app-default is used which is part of the data stream naming scheme. Many parts in observability assume this naming scheme to be followed. The target restore index does not match the scheme. This has the consequence, that the restored data stream does not automatically show up in Observability.

Instead, I would propose to flip around the naming for the rename_replacement to "rename_replacement": "$1_restored". The consequence of this, that the restored index then has the name logs-my_app-default_default which matches the data stream naming scheme and users can directly work with it.

The advantage of the current approach is, that the user puts the restored data into a "parking" spot where it is not directly seen. Later reindexing fixes this. At the same time, I assume if a user restores, the data is intended to be used with the existing UI's. I did not open a PR directly to have first a conversation around this. On the examples, I would suggest to also separate restoring data streams from indices as what we discuss here, is very specific to the data stream naming scheme.

elasticsearchmachine commented 1 year ago

Pinging @elastic/es-distributed (Team:Distributed)