You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by md...@apache.org on 2022/05/16 17:42:48 UTC

[lucene-solr] branch branch_8_11 updated: LUCENE-10481: FacetsCollector will not request scores if it does not use them (#2654)

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

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


The following commit(s) were added to refs/heads/branch_8_11 by this push:
     new 1d4dd907523 LUCENE-10481: FacetsCollector will not request scores if it does not use them (#2654)
1d4dd907523 is described below

commit 1d4dd907523a0acdbff1ae0f9ffe4d02375d2a53
Author: Mike Drob <md...@apache.org>
AuthorDate: Mon May 16 12:42:37 2022 -0500

    LUCENE-10481: FacetsCollector will not request scores if it does not use them (#2654)
---
 lucene/CHANGES.txt                                                 | 5 +++++
 lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 40a5f82c6a6..de19f459028 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -9,6 +9,11 @@ Bug Fixes
 ---------------------
 (No changes)
 
+Optimizations
+---------------------
+
+* LUCENE-10481: FacetsCollector will not request scores if it does not use them. (Mike Drob)
+
 ======================= Lucene 8.11.1 =======================
 
 Bug Fixes
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java b/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java
index 3626b91c59e..1f2b28ba636 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java
@@ -133,7 +133,7 @@ public class FacetsCollector extends SimpleCollector implements Collector {
 
   @Override
   public ScoreMode scoreMode() {
-    return ScoreMode.COMPLETE;
+    return keepScores ? ScoreMode.COMPLETE : ScoreMode.COMPLETE_NO_SCORES;
   }
 
   @Override