diff --git a/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java b/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java index 03e4b9c53bc..55cf2cbf905 100644 --- a/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java +++ b/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java @@ -164,10 +164,14 @@ class QueryDocValues extends FloatDocValues { } } - @Override + @Override public Object objectVal(int doc) { - return floatVal(doc); - } + try { + return exists(doc) ? scorer.score() : null; + } catch (IOException e) { + throw new RuntimeException("caught exception in QueryDocVals(" + q + ") doc=" + doc, e); + } + } @Override public ValueFiller getValueFiller() {