diff --git a/src/main/java/org/elasticsearch/indices/cache/filter/terms/IndicesTermsFilterCache.java b/src/main/java/org/elasticsearch/indices/cache/filter/terms/IndicesTermsFilterCache.java index e0de300ec1d..1738e4d9676 100644 --- a/src/main/java/org/elasticsearch/indices/cache/filter/terms/IndicesTermsFilterCache.java +++ b/src/main/java/org/elasticsearch/indices/cache/filter/terms/IndicesTermsFilterCache.java @@ -158,6 +158,7 @@ public class IndicesTermsFilterCache extends AbstractComponent { public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException { // only call the terms filter once per execution (across segments per single search request) if (!termsFilterCalled) { + termsFilterCalled = true; termsFilter = cache.termsFilter(cacheKey, lookup); } if (termsFilter == null) return null;