Filter search results with same ID using different indices

Hello together,

i have a simple query that performs a search on an alias. This alias contains several indices.
Documents are stored in the different indexes with the same id, but have a different status, so they differ in content.

Now when I do a search I want to search all indexes but return the document from the most recent index.

Is it possible to remove documents with the same id, and can this be decided on the index?

Greetings,
Tim