diff --git a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authz/accesscontrol/OptOutQueryCache.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authz/accesscontrol/OptOutQueryCache.java index 3e3006a0101..ce8e6cfa7c7 100644 --- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authz/accesscontrol/OptOutQueryCache.java +++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authz/accesscontrol/OptOutQueryCache.java @@ -55,7 +55,7 @@ public final class OptOutQueryCache extends AbstractIndexComponent implements Qu // At this level only IndicesRequest final String indexName; if (context.getRequest() instanceof ShardSearchRequest) { - indexName = ((ShardSearchRequest) context.getRequest()).index(); + indexName = ((ShardSearchRequest) context.getRequest()).shardId().getIndexName(); } else if (context.getRequest() instanceof BroadcastShardRequest) { indexName = ((BroadcastShardRequest) context.getRequest()).shardId().getIndexName(); } else {