There's a deprecated feature in the reindex api which makes (made?) it possible to maintain the timestamp order between docs being reindexed using the reindex api. However, the documentation states that this is a deprecated feature and should not be used and/or used with caution.
What I'd like to accomplish is to retrieve all documents in @timestamp order and reindex them in that order but rewrite the @timestamp with an ingest pipeline. This seems(?) to work up to the version we're using currently using (v8.10.4) but it will be broken in the near future I assume...
Is there a possibility to emulate this behavior using plain vanilla Elastisearch functionality without relying on any external scroll-api based solutions? We have a number of use cases where we're not able to give users the ability to access ES using any programmatic (python, java whatever) means except the standard ES api:s using the Kibana dev tool.
The way I've approached this so far is:
POST _reindex
{
"source": {
"index": "<some index>",
"query": {
"query_string": {
"query": "@timestamp:*"
}
},
"sort": [
{ "@timestamp" : {"order" : "asc"}}
]
},
"dest": {
"index": "<some new index>",
"pipeline": "set-timestamp"
}
}
Is this a "proper" approach given my use case?
Many thanks in advance.