On a time series multi index environment where a new index is created every month what is the best approach to search for a document by id to ensure the document is unique among all indexes?
I came up with two solutions:
- Using the search API and search across multiple indexes using a wildcard for the index name.
pro: Simple and supposingly the standard approach.
cons:Does not provide realtime results, it's affected by the refresh rate.
Because in our setup it could happen that the same documents is potentially added to the index in a very short amount of time we would prefer to use the Get API since it provides realtime results.
- Using the multi Get API and individually query every index. In order to get all indexes that need to be queried in the multi get request we first use the Get Index API specifying the indexes to be searched with a wildcard.
pro: provides realtime data.
cons: we don't know if this is scalable (max 12 indexes) and what the performance of the Get Index API is.
Anyone has a better suggestion on how we could achieve this, or any insight if the proposed method 2) is sustainable?