From 93c70de78453e33d7f9962319c754a213cde0737 Mon Sep 17 00:00:00 2001 From: bowenlan-amzn Date: Mon, 29 Jan 2024 10:52:03 -0800 Subject: [PATCH] remove segment level match check at shard level Signed-off-by: bowenlan-amzn --- .../aggregations/bucket/FastFilterRewriteHelper.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/FastFilterRewriteHelper.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/FastFilterRewriteHelper.java index 7527ecefa4198..382914c496713 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/FastFilterRewriteHelper.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/FastFilterRewriteHelper.java @@ -123,14 +123,8 @@ public static long[] getAggregationBounds(final SearchContext context, final Str } else if (cq instanceof MatchAllDocsQuery) { return indexBounds; } - // Check if the top-level query (which may be a PRQ on another field) is functionally match-all - Weight weight = context.searcher().createWeight(context.query(), ScoreMode.COMPLETE_NO_SCORES, 1f); - for (LeafReaderContext ctx : context.searcher().getIndexReader().leaves()) { - if (weight.count(ctx) != ctx.reader().numDocs()) { - return null; - } - } - return indexBounds; + + return null; } /**