From db21fb0bbd6c0ec75299d3a330729ba2d658d5af Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Mon, 22 Apr 2013 14:08:10 +0000 Subject: [PATCH] SOLR-4746: fix JSON output for distributed grouping top level git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1470523 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 5 +++++ .../endresulttransformer/GroupedEndResultTransformer.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index fffaafe6310..ef4a848f668 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -231,6 +231,11 @@ Bug Fixes * SOLR-4716,SOLR-4584: SolrCloud request proxying does not work on Tomcat and perhaps other non Jetty containers. (Po Rui, Yago Riveiro via Mark Miller) +* SOLR-4746: Distributed grouping used a NamedList instead of a SimpleOrderedMap + for the top level group commands, causing output formatting differences + compared to non-distributed grouping. (yonik) + + Optimizations ---------------------- diff --git a/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/GroupedEndResultTransformer.java b/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/GroupedEndResultTransformer.java index 026cc4f572e..0414affc82b 100644 --- a/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/GroupedEndResultTransformer.java +++ b/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/GroupedEndResultTransformer.java @@ -50,7 +50,7 @@ public class GroupedEndResultTransformer implements EndResultTransformer { */ @Override public void transform(Map result, ResponseBuilder rb, SolrDocumentSource solrDocumentSource) { - NamedList commands = new NamedList(); + NamedList commands = new SimpleOrderedMap(); for (Map.Entry entry : result.entrySet()) { Object value = entry.getValue(); if (TopGroups.class.isInstance(value)) {