Is it possible to change document id?

Could someone help, please?
How can I change document id which is used in URL: <index_name>/_doc/<id>

Welcome!

You need to reindex the document.

Something like:

GET <index_name>/_doc/<id>/_source

This gives a json document as a result.

{
  "foo": "bar"
}

Then run:

PUT <index_name>/_doc/<new-id>
{
  "foo": "bar"
}
DELETE <index_name>/_doc/<id>
1 Like

Thank you!

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