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),