You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2020/03/16 04:28:20 UTC

[lucene-solr] branch branch_8x updated: LUCENE-8103: Revert QueryValueSource.objectVal change

This is an automated email from the ASF dual-hosted git repository.

dsmiley pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 1d7c6be  LUCENE-8103: Revert QueryValueSource.objectVal change
1d7c6be is described below

commit 1d7c6be57223c394b061c228f4803b297b7181b0
Author: David Smiley <ds...@apache.org>
AuthorDate: Mon Mar 16 00:27:04 2020 -0400

    LUCENE-8103: Revert QueryValueSource.objectVal change
    
    (cherry picked from commit 261e7ba86cb1d9c97b7f80e7f2c6b9d1ed59b988)
---
 .../lucene/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 03e4b9c..55cf2cb 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() {