Working with alias referencing multiple indices in Java native API

I am getting an exception when trying to use prepareGet API with aliases that reference more than one index. The exception message is self-explanatory and says that multi-index alias can't be used with single index operation.

I've am working with a daily index and I need to be able to get documents from a multi-index alias.

I assume I can use the multi-get API but it is more cumbersome and requires to

  1. Get the list of indices from the alias
  2. Prepare the multi get request
  3. Iterate over the multi get responses

Is there an alternative solution? Java REST client?

Thanks.

I was able to use the multi-index alias with search API instead of get API. I guess it is less efficient but it is clear & simple.

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