diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/MatchAllQueryParser.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/MatchAllQueryParser.java index 005a95d1c35..1e8faa4c3c4 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/MatchAllQueryParser.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/MatchAllQueryParser.java @@ -70,7 +70,7 @@ public class MatchAllQueryParser extends AbstractIndexComponent implements XCont } if (boost == 1.0f && normsField == null) { - return new DeletionAwareConstantScoreQuery(parseContext.cacheFilterIfPossible(Queries.MATCH_ALL_FILTER)); + return new DeletionAwareConstantScoreQuery(Queries.MATCH_ALL_FILTER, true); // no need to cache a MATCH ALL FILTER } MatchAllDocsQuery query = new MatchAllDocsQuery(normsField); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/FacetsPhase.java b/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/FacetsPhase.java index 689527c412d..3e3bbae5949 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/FacetsPhase.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/FacetsPhase.java @@ -60,7 +60,7 @@ public class FacetsPhase implements SearchPhase { // run global facets ... if (context.searcher().globalCollectors() != null) { - Query query = new DeletionAwareConstantScoreQuery(Queries.MATCH_ALL_FILTER); // no need to cache a MATCH ALL FILTER + Query query = new DeletionAwareConstantScoreQuery(Queries.MATCH_ALL_FILTER, true); // no need to cache a MATCH ALL FILTER if (context.types().length > 0) { if (context.types().length == 1) { String type = context.types()[0];