You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2019/06/28 17:59:10 UTC

[lucene-solr] 03/03: SOLR-13576: Factor out a TopGroupsShardResponseProcessor.fillResultIds method. (Christine Poerschke, Diego Ceccarelli)

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

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

commit a49ddbaf116e82b3af5b15b3ddb6f64954aa2951
Author: Christine Poerschke <cp...@apache.org>
AuthorDate: Fri Jun 28 18:38:41 2019 +0100

    SOLR-13576: Factor out a TopGroupsShardResponseProcessor.fillResultIds method. (Christine Poerschke, Diego Ceccarelli)
---
 solr/CHANGES.txt                                                   | 2 ++
 .../responseprocessor/TopGroupsShardResponseProcessor.java         | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 73bfdb4..26aa716 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -219,6 +219,8 @@ Other Changes
 
 * SOLR-13279: Clarify ScheduledTrigger's "every parameter missing" error response. (Christine Poerschke)
 
+* SOLR-13576: Factor out a TopGroupsShardResponseProcessor.fillResultIds method. (Christine Poerschke, Diego Ceccarelli)
+
 ==================  8.1.2 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
diff --git a/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java b/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java
index 2db6b22..3ccecd1 100644
--- a/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java
+++ b/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java
@@ -188,7 +188,14 @@ public class TopGroupsShardResponseProcessor implements ShardResponseProcessor {
       }
       rb.mergedQueryCommandResults.put(query, new QueryCommandResult(mergedTopDocs, mergedMatches, maxScore));
     }
+    fillResultIds(rb);
+  }
 
+  /**
+   * Fill the {@link ResponseBuilder}'s <code>resultIds</code> field.
+   * @param rb the response builder
+   */
+  static void fillResultIds(ResponseBuilder rb) {
     Map<Object, ShardDoc> resultIds = new HashMap<>();
     int i = 0;
     for (TopGroups<BytesRef> topGroups : rb.mergedTopGroups.values()) {