diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexAbstractionResolver.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexAbstractionResolver.java index add6ff97597fc..b7781680aca92 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexAbstractionResolver.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexAbstractionResolver.java @@ -103,7 +103,7 @@ public List resolveIndexAbstractions(Iterable indices, IndicesOp } else if (dateMathName.equals(indexAbstraction)) { if (minus) { finalIndices.remove(indexAbstraction); - } else { + } else if (indicesOptions.ignoreUnavailable() == false || availableIndexAbstractions.contains(indexAbstraction)) { finalIndices.add(indexAbstraction); } } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolver.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolver.java index 27bf9ac1f21c4..fe9bec298c8bd 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolver.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolver.java @@ -222,11 +222,6 @@ ResolvedIndices resolveIndicesAndAliases(String action, IndicesRequest indicesRe } List replaced = indexAbstractionResolver.resolveIndexAbstractions(split.getLocal(), indicesOptions, metadata, authorizedIndices, replaceWildcards, indicesRequest.includeDataStreams()); - if (indicesOptions.ignoreUnavailable()) { - //out of all the explicit names (expanded from wildcards and original ones that were left untouched) - //remove all the ones that the current user is not authorized for and ignore them - replaced = replaced.stream().filter(authorizedIndices::contains).collect(Collectors.toList()); - } resolvedIndicesBuilder.addLocal(replaced); resolvedIndicesBuilder.addRemote(split.getRemote()); }