From 23a3287f000454f1cf1aa3b4949bb8ec02ed37d6 Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Wed, 18 Jun 2014 19:55:28 +0000 Subject: [PATCH] SOLR-6064: Return DebugComponent track output as JSON object git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1603608 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 3 +++ .../handler/component/DebugComponent.java | 26 +++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index fa799d938f4..31d7c56770e 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -153,6 +153,9 @@ New Features * SOLR-6125: Allow SolrIndexWriter to close without waiting for merges (Christine Poerschke via Alan Woodward) +* SOLR-6064: DebugComponent track output should be returned as a JSON + object rather than a list (Christine Poerschke, Alan Woodward) + Bug Fixes ---------------------- diff --git a/solr/core/src/java/org/apache/solr/handler/component/DebugComponent.java b/solr/core/src/java/org/apache/solr/handler/component/DebugComponent.java index 6f5f44c1fea..21d6ff59e6a 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/DebugComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/DebugComponent.java @@ -17,7 +17,16 @@ package org.apache.solr.handler.component; -import static org.apache.solr.common.params.CommonParams.FQ; +import org.apache.lucene.search.Query; +import org.apache.solr.common.SolrDocumentList; +import org.apache.solr.common.params.CommonParams; +import org.apache.solr.common.params.ModifiableSolrParams; +import org.apache.solr.common.util.NamedList; +import org.apache.solr.common.util.SimpleOrderedMap; +import org.apache.solr.request.SolrQueryRequest; +import org.apache.solr.search.DocList; +import org.apache.solr.search.QueryParsing; +import org.apache.solr.util.SolrPluginUtils; import java.io.IOException; import java.net.URL; @@ -32,16 +41,7 @@ import java.util.Set; import java.util.TreeMap; import java.util.concurrent.atomic.AtomicLong; -import org.apache.lucene.search.Query; -import org.apache.solr.common.SolrDocumentList; -import org.apache.solr.common.params.CommonParams; -import org.apache.solr.common.params.ModifiableSolrParams; -import org.apache.solr.common.util.NamedList; -import org.apache.solr.common.util.SimpleOrderedMap; -import org.apache.solr.request.SolrQueryRequest; -import org.apache.solr.search.DocList; -import org.apache.solr.search.QueryParsing; -import org.apache.solr.util.SolrPluginUtils; +import static org.apache.solr.common.params.CommonParams.FQ; /** * Adds debugging information to a request. @@ -183,7 +183,7 @@ public class DebugComponent extends SearchComponent @SuppressWarnings("unchecked") NamedList stageList = (NamedList) ((NamedList)rb.getDebugInfo().get("track")).get(stages.get(rb.stage)); if(stageList == null) { - stageList = new NamedList<>(); + stageList = new SimpleOrderedMap<>(); rb.addDebug(stageList, "track", stages.get(rb.stage)); } for(ShardResponse response: sreq.responses) { @@ -261,7 +261,7 @@ public class DebugComponent extends SearchComponent private NamedList getTrackResponse(ShardResponse shardResponse) { - NamedList namedList = new NamedList<>(); + NamedList namedList = new SimpleOrderedMap<>(); if (shardResponse.getException() != null) { namedList.add("Exception", shardResponse.getException().getMessage()); return namedList;