From d021b1bfebc8605d978437d960a523c00c055fe9 Mon Sep 17 00:00:00 2001 From: Britta Weber Date: Tue, 13 Oct 2015 14:35:32 +0200 Subject: [PATCH] assert that doc was actually found --- .../lucene/search/function/FiltersFunctionScoreQuery.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/common/lucene/search/function/FiltersFunctionScoreQuery.java b/core/src/main/java/org/elasticsearch/common/lucene/search/function/FiltersFunctionScoreQuery.java index 314135db661..210b32d5e42 100644 --- a/core/src/main/java/org/elasticsearch/common/lucene/search/function/FiltersFunctionScoreQuery.java +++ b/core/src/main/java/org/elasticsearch/common/lucene/search/function/FiltersFunctionScoreQuery.java @@ -225,7 +225,8 @@ public class FiltersFunctionScoreQuery extends Query { } FiltersFunctionFactorScorer scorer = (FiltersFunctionFactorScorer)scorer(context); - scorer.advance(doc); + int actualDoc = scorer.advance(doc); + assert (actualDoc == doc); double score = scorer.computeScore(doc, subQueryExpl.getValue()); Explanation factorExplanation = Explanation.match( CombineFunction.toFloat(score),