mirror of https://github.com/apache/lucene.git
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
This commit is contained in:
parent
ac9f70adc8
commit
23a3287f00
|
@ -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
|
||||
----------------------
|
||||
|
|
|
@ -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<Object> stageList = (NamedList<Object>) ((NamedList<Object>)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<String> getTrackResponse(ShardResponse shardResponse) {
|
||||
NamedList<String> namedList = new NamedList<>();
|
||||
NamedList<String> namedList = new SimpleOrderedMap<>();
|
||||
if (shardResponse.getException() != null) {
|
||||
namedList.add("Exception", shardResponse.getException().getMessage());
|
||||
return namedList;
|
||||
|
|
Loading…
Reference in New Issue