From d010cdd87eec89bf6308351b817d9ec1d5c6e14e Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Tue, 24 Jul 2018 12:10:25 +0200 Subject: [PATCH] LUCENE-8412: Fix TestDistributedGrouping failure. --- .../grouping/distributed/command/TopGroupsFieldCommand.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java b/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java index 3902841ab4f..b6182864e60 100644 --- a/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java +++ b/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java @@ -173,8 +173,10 @@ public class TopGroupsFieldCommand implements Command> { } else { topGroups = secondPassCollector.getTopGroups(0); } - for (GroupDocs group : topGroups.groups) { - TopFieldCollector.populateScores(group.scoreDocs, searcher, query); + if (needScores) { + for (GroupDocs group : topGroups.groups) { + TopFieldCollector.populateScores(group.scoreDocs, searcher, query); + } } }