From 261e7ba86cb1d9c97b7f80e7f2c6b9d1ed59b988 Mon Sep 17 00:00:00 2001 From: David Smiley Date: Mon, 16 Mar 2020 00:27:04 -0400 Subject: [PATCH] LUCENE-8103: Revert QueryValueSource.objectVal change --- .../queries/function/valuesource/QueryValueSource.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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() {