GetIndicesFromAlias Throws Exception When Alias Doesn't Exist
nfratin opened this issue · 1 comments
nfratin commented
I'm trying to use getIndicesFromAlias and it's throwing a JestElasticSearchException when it can't find the index.
This is the code that throws.
public Set<String> getIndicesFromAlias(String aliasName) {
JestResult result = execute(new GetAliases.Builder().addIndex(aliasName).build());
if (!result.isSucceeded()) {
return Collections.emptySet();
}
It seems to me that it should be using the other execute and passing in acceptNotFound as true. So it should be:
JestResult result = execute(new GetAliases.Builder().addIndex(aliasName).build(), true);
Was wondering if this was the intended action, or should I be catching the 404 and dealing with it myself.
Thanks