From 809c7d07f001c9af905e476dd2a9d3a2b155afcd Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 2 Dec 2013 11:05:43 +0100 Subject: [PATCH] only wrap the parentFilter in ApplyAcceptedDocsFilter, not the other short circuit filters. --- .../org/elasticsearch/index/search/child/ChildrenQuery.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/search/child/ChildrenQuery.java b/src/main/java/org/elasticsearch/index/search/child/ChildrenQuery.java index 70356cc1eea..b87371586ac 100644 --- a/src/main/java/org/elasticsearch/index/search/child/ChildrenQuery.java +++ b/src/main/java/org/elasticsearch/index/search/child/ChildrenQuery.java @@ -171,7 +171,7 @@ public class ChildrenQuery extends Query { } else if (size <= shortCircuitParentDocSet) { parentFilter = new ParentIdsFilter(parentType, uidToScore.v().keys, uidToScore.v().allocated); } else { - parentFilter = this.parentFilter; + parentFilter = new ApplyAcceptedDocsFilter(this.parentFilter); } ParentWeight parentWeight = new ParentWeight(rewrittenChildQuery.createWeight(searcher), parentFilter, searchContext, size, uidToScore, uidToCount); searchContext.addReleasable(parentWeight); @@ -190,7 +190,7 @@ public class ChildrenQuery extends Query { private ParentWeight(Weight childWeight, Filter parentFilter, SearchContext searchContext, int remaining, Recycler.V> uidToScore, Recycler.V> uidToCount) { this.childWeight = childWeight; - this.parentFilter = new ApplyAcceptedDocsFilter(parentFilter); + this.parentFilter = parentFilter; this.searchContext = searchContext; this.remaining = remaining; this.uidToScore = uidToScore;