lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject svn commit: r1721170 - in /lucene/dev/trunk/solr: ./ contrib/clustering/src/java/org/apache/solr/handler/clustering/ contrib/clustering/src/test/org/apache/solr/handler/clustering/ contrib/velocity/src/java/org/apache/solr/response/ core/src/java/org/a...
Date Mon, 21 Dec 2015 14:39:22 GMT
Author: cpoerschke
Date: Mon Dec 21 14:39:21 2015
New Revision: 1721170

URL: http://svn.apache.org/viewvc?rev=1721170&view=rev
Log:
SOLR-8317: use responseHeader and response accessors to SolrQueryResponse

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/ClusteringComponent.java
    lucene/dev/trunk/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/ClusteringComponentTest.java
    lucene/dev/trunk/solr/contrib/velocity/src/java/org/apache/solr/response/PageTool.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/ResponseLogComponent.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/XMLWriter.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/MainEndResultTransformer.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/JSONWriterTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/SmileWriterTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/response/TestCSVResponseWriter.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/response/TestPHPSerializedResponseWriter.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Mon Dec 21 14:39:21 2015
@@ -368,7 +368,7 @@ Other Changes
 * SOLR-8419: TermVectorComponent for distributed search now requires a uniqueKey in the schema.
 Also, it no longer
   returns "uniqueKeyField" in the response. (David Smiley)
 
-* SOLR-8317: add responseHeader and response accessors to SolrQueryResponse. (Christine Poerschke)
+* SOLR-8317: add & use responseHeader and response accessors to SolrQueryResponse. (Christine
Poerschke)
 
 ==================  5.4.0 ==================
 

Modified: lucene/dev/trunk/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/ClusteringComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/ClusteringComponent.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/ClusteringComponent.java
(original)
+++ lucene/dev/trunk/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/ClusteringComponent.java
Mon Dec 21 14:39:21 2015
@@ -273,7 +273,7 @@ public class ClusteringComponent extends
       SearchClusteringEngine engine = searchClusteringEngines.get(name);
       if (engine != null) {
         checkAvailable(name, engine);
-        SolrDocumentList solrDocList = (SolrDocumentList) rb.rsp.getValues().get("response");
+        SolrDocumentList solrDocList = (SolrDocumentList) rb.rsp.getResponse();
         // TODO: Currently, docIds is set to null in distributed environment.
         // This causes CarrotParams.PRODUCE_SUMMARY doesn't work.
         // To work CarrotParams.PRODUCE_SUMMARY under distributed mode, we can choose either
one of:

Modified: lucene/dev/trunk/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/ClusteringComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/ClusteringComponentTest.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/ClusteringComponentTest.java
(original)
+++ lucene/dev/trunk/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/ClusteringComponentTest.java
Mon Dec 21 14:39:21 2015
@@ -52,7 +52,7 @@ public class ClusteringComponentTest ext
     SolrRequestHandler handler = core.getRequestHandler("standard");
     SolrQueryResponse rsp;
     rsp = new SolrQueryResponse();
-    rsp.add("responseHeader", new SimpleOrderedMap<>());
+    rsp.addResponseHeader(new SimpleOrderedMap<>());
     SolrQueryRequest req = new LocalSolrQueryRequest(core, params);
     handler.handleRequest(req, rsp);
     NamedList<?> values = rsp.getValues();
@@ -70,7 +70,7 @@ public class ClusteringComponentTest ext
     handler = core.getRequestHandler("docClustering");
 
     rsp = new SolrQueryResponse();
-    rsp.add("responseHeader", new SimpleOrderedMap<>());
+    rsp.addResponseHeader(new SimpleOrderedMap<>());
     req = new LocalSolrQueryRequest(core, params);
     handler.handleRequest(req, rsp);
     values = rsp.getValues();

Modified: lucene/dev/trunk/solr/contrib/velocity/src/java/org/apache/solr/response/PageTool.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/velocity/src/java/org/apache/solr/response/PageTool.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/velocity/src/java/org/apache/solr/response/PageTool.java
(original)
+++ lucene/dev/trunk/solr/contrib/velocity/src/java/org/apache/solr/response/PageTool.java
Mon Dec 21 14:39:21 2015
@@ -42,7 +42,7 @@ public class PageTool {
       results_per_page = new Integer(rows);
     }
     //TODO: Handle group by results
-    Object docs = response.getValues().get("response");
+    Object docs = response.getResponse();
     if (docs != null) {
       if (docs instanceof DocSlice) {
         DocSlice doc_slice = (DocSlice) docs;

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java Mon Dec 21 14:39:21
2015
@@ -2079,7 +2079,7 @@ public final class SolrCore implements S
   public static void preDecorateResponse(SolrQueryRequest req, SolrQueryResponse rsp) {
     // setup response header
     final NamedList<Object> responseHeader = new SimpleOrderedMap<>();
-    rsp.add("responseHeader", responseHeader);
+    rsp.addResponseHeader(responseHeader);
 
     // toLog is a local ref to the same NamedList used by the response
     NamedList<Object> toLog = rsp.getToLog();

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java Mon
Dec 21 14:39:21 2015
@@ -212,7 +212,7 @@ public class MoreLikeThisHandler extends
         if (mltDocs == null) {
           mltDocs = new DocListAndSet(); // avoid NPE
         }
-        rsp.add("response", mltDocs.docList);
+        rsp.addResponse(mltDocs.docList);
 
 
         if (interesting != null) {

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
Mon Dec 21 14:39:21 2015
@@ -353,7 +353,7 @@ public class QueryComponent extends Sear
       rb.setResults(res);
 
       ResultContext ctx = new BasicResultContext(rb);
-      rsp.add("response", ctx);
+      rsp.addResponse(ctx);
       return;
     }
 
@@ -506,7 +506,7 @@ public class QueryComponent extends Sear
 
         if (grouping.mainResult != null) {
           ResultContext ctx = new BasicResultContext(rb, grouping.mainResult);
-          rsp.add("response", ctx);
+          rsp.addResponse(ctx);
           rsp.getToLog().add("hits", grouping.mainResult.matches());
         } else if (!grouping.getCommands().isEmpty()) { // Can never be empty since grouping.execute()
checks for this.
           rsp.add("grouped", result.groupedResults);
@@ -523,7 +523,7 @@ public class QueryComponent extends Sear
     rb.setResult(result);
 
     ResultContext ctx = new BasicResultContext(rb);
-    rsp.add("response", ctx);
+    rsp.addResponse(ctx);
     rsp.getToLog().add("hits", rb.getResults().docList.matches());
 
     if ( ! rb.req.getParams().getBool(ShardParams.IS_SHARD,false) ) {
@@ -822,7 +822,7 @@ public class QueryComponent extends Sear
       }
     }
 
-    rb.rsp.add("response", rb._responseDocs);
+    rb.rsp.addResponse(rb._responseDocs);
     if (null != rb.getNextCursorMark()) {
       rb.rsp.add(CursorMarkParams.CURSOR_MARK_NEXT,
                  rb.getNextCursorMark().getSerializedTotem());

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
Mon Dec 21 14:39:21 2015
@@ -221,7 +221,7 @@ public class RealTimeGetComponent extend
      rsp.add("doc", docList.size() > 0 ? docList.get(0) : null);
    } else {
      docList.setNumFound(docList.size());
-     rsp.add("response", docList);
+     rsp.addResponse(docList);
    }
 
   }
@@ -499,7 +499,7 @@ public class RealTimeGetComponent extend
       rb.rsp.add("doc", docList.size() > 0 ? docList.get(0) : null);
     } else {
       docList.setNumFound(docList.size());
-      rb.rsp.add("response", docList);
+      rb.rsp.addResponse(docList);
     }
   }
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/ResponseLogComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/ResponseLogComponent.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/ResponseLogComponent.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/ResponseLogComponent.java
Mon Dec 21 14:39:21 2015
@@ -70,7 +70,7 @@ public class ResponseLogComponent extend
     IndexSchema schema = searcher.getSchema();
     if (schema.getUniqueKeyField() == null) return;
 
-    ResultContext rc = (ResultContext) rb.rsp.getValues().get("response");
+    ResultContext rc = (ResultContext) rb.rsp.getResponse();
 
     DocList docs = rc.getDocList();
     if (docs.hasScores()) {

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
Mon Dec 21 14:39:21 2015
@@ -290,11 +290,11 @@ public class SearchHandler extends Reque
         }
       } catch (ExitableDirectoryReader.ExitingReaderException ex) {
         log.warn( "Query: " + req.getParamString() + "; " + ex.getMessage());
-        SolrDocumentList r = (SolrDocumentList) rb.rsp.getValues().get("response");
+        SolrDocumentList r = (SolrDocumentList) rb.rsp.getResponse();
         if(r == null)
           r = new SolrDocumentList();
         r.setNumFound(0);
-        rb.rsp.add("response", r);
+        rb.rsp.addResponse(r);
         if(rb.isDebug()) {
           NamedList debug = new NamedList();
           debug.add("explain", new NamedList());

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java
Mon Dec 21 14:39:21 2015
@@ -50,7 +50,7 @@ public class BinaryResponseWriter implem
   public void write(OutputStream out, SolrQueryRequest req, SolrQueryResponse response) throws
IOException {
     Resolver resolver = new Resolver(req, response.getReturnFields());
     Boolean omitHeader = req.getParams().getBool(CommonParams.OMIT_HEADER);
-    if (omitHeader != null && omitHeader) response.getValues().remove("responseHeader");
+    if (omitHeader != null && omitHeader) response.removeResponseHeader();
     new JavaBinCodec(resolver).setWritableDocFields(resolver).marshal(response.getValues(),
out);
   }
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java Mon
Dec 21 14:39:21 2015
@@ -236,7 +236,7 @@ class CSVWriter extends TextResponseWrit
     }
 
     Collection<String> fields = returnFields.getRequestedFieldNames();
-    Object responseObj = rsp.getValues().get("response");
+    Object responseObj = rsp.getResponse();
     boolean returnOnlyStored = false;
     if (fields==null||returnFields.hasPatternMatching()) {
       if (responseObj instanceof SolrDocumentList) {

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java Mon
Dec 21 14:39:21 2015
@@ -92,7 +92,7 @@ class JSONWriter extends TextResponseWri
         writer.write(wrapperFunction + "(");
     }
     Boolean omitHeader = req.getParams().getBool(CommonParams.OMIT_HEADER);
-    if(omitHeader != null && omitHeader) rsp.getValues().remove("responseHeader");
+    if(omitHeader != null && omitHeader) rsp.removeResponseHeader();
     writeNamedList(null, rsp.getValues());
     if(wrapperFunction!=null) {
         writer.write(')');

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java
Mon Dec 21 14:39:21 2015
@@ -81,7 +81,7 @@ class PHPSerializedWriter extends JSONWr
   @Override
   public void writeResponse() throws IOException {
     Boolean omitHeader = req.getParams().getBool(CommonParams.OMIT_HEADER);
-    if(omitHeader != null && omitHeader) rsp.getValues().remove("responseHeader");
+    if(omitHeader != null && omitHeader) rsp.removeResponseHeader();
     writeNamedList(null, rsp.getValues());
   }
   

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/XMLWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/XMLWriter.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/XMLWriter.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/response/XMLWriter.java Mon Dec 21
14:39:21 2015
@@ -104,9 +104,9 @@ public class XMLWriter extends TextRespo
     writer.write(XML_START2_NOSCHEMA);
 
     // dump response values
-    NamedList<?> lst = rsp.getValues();
     Boolean omitHeader = req.getParams().getBool(CommonParams.OMIT_HEADER);
-    if(omitHeader != null && omitHeader) lst.remove("responseHeader");
+    if(omitHeader != null && omitHeader) rsp.removeResponseHeader();
+    final NamedList<?> lst = rsp.getValues();
     int sz = lst.size();
     int start=0;
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/MainEndResultTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/MainEndResultTransformer.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/MainEndResultTransformer.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/MainEndResultTransformer.java
Mon Dec 21 14:39:21 2015
@@ -57,7 +57,7 @@ public class MainEndResultTransformer im
       if (maxScore != Float.NEGATIVE_INFINITY) {
         docList.setMaxScore(maxScore);
       }
-      rb.rsp.add("response", docList);
+      rb.rsp.addResponse(docList);
     }
   }
 }

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java
Mon Dec 21 14:39:21 2015
@@ -139,7 +139,7 @@ public class IgnoreCommitOptimizeUpdateP
           } else {
             responseHeader = new SimpleOrderedMap<Object>();
             responseHeader.add("msg", responseMsg);
-            rsp.add("responseHeader", responseHeader);
+            rsp.addResponseHeader(responseHeader);
           }
         }
       }

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java Mon Dec
21 14:39:21 2015
@@ -710,7 +710,7 @@ public class BasicFunctionalityTest exte
     SolrQueryResponse rsp = new SolrQueryResponse();
     core.execute(core.getRequestHandler(req.getParams().get(CommonParams.QT)), req, rsp);
 
-    DocList dl = ((ResultContext) rsp.getValues().get("response")).getDocList();
+    DocList dl = ((ResultContext) rsp.getResponse()).getDocList();
     StoredDocument d = req.getSearcher().doc(dl.iterator().nextDoc());
     // ensure field in fl is not lazy
     assertFalse( ((Field) d.getField("test_hlt")).getClass().getSimpleName().equals("LazyField"));
@@ -735,7 +735,7 @@ public class BasicFunctionalityTest exte
     SolrQueryResponse rsp = new SolrQueryResponse();
     core.execute(core.getRequestHandler(req.getParams().get(CommonParams.QT)), req, rsp);
 
-    DocList dl = ((ResultContext) rsp.getValues().get("response")).getDocList();
+    DocList dl = ((ResultContext) rsp.getResponse()).getDocList();
     DocIterator di = dl.iterator();    
     StoredDocument d1 = req.getSearcher().doc(di.nextDoc());
     StorableField[] values1 = null;
@@ -757,7 +757,7 @@ public class BasicFunctionalityTest exte
     rsp = new SolrQueryResponse();
     core.execute(core.getRequestHandler(req.getParams().get(CommonParams.QT)), req, rsp);
 
-    dl = ((ResultContext) rsp.getValues().get("response")).getDocList();
+    dl = ((ResultContext) rsp.getResponse()).getDocList();
     di = dl.iterator();    
     StoredDocument d2 = req.getSearcher().doc(di.nextDoc());
     // ensure same doc, same lazy field now

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestGroupingSearch.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestGroupingSearch.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestGroupingSearch.java Mon Dec 21
14:39:21 2015
@@ -273,7 +273,7 @@ public class TestGroupingSearch extends
       SolrRequestInfo.clearRequestInfo();
     }
 
-    assertEquals(6, ((ResultContext) response.getValues().get("response")).getDocList().matches());
+    assertEquals(6, ((ResultContext) response.getResponse()).getDocList().matches());
     new BinaryResponseParser().processResponse(new ByteArrayInputStream(out.toByteArray()),
"");
     out.close();
   }

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
(original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
Mon Dec 21 14:39:21 2015
@@ -297,7 +297,7 @@ public class SpellCheckComponentTest ext
 
         SolrRequestHandler handler = core.getRequestHandler("spellCheckCompRH");
         SolrQueryResponse rsp = new SolrQueryResponse();
-        rsp.add("responseHeader", new SimpleOrderedMap());
+        rsp.addResponseHeader(new SimpleOrderedMap());
         SolrQueryRequest req = new LocalSolrQueryRequest(core, params);
         handler.handleRequest(req, rsp);
         req.close();
@@ -310,7 +310,7 @@ public class SpellCheckComponentTest ext
         params.remove(SpellingParams.SPELLCHECK_DICT);
         params.add(SpellingParams.SPELLCHECK_DICT, "threshold_direct");
         rsp = new SolrQueryResponse();
-        rsp.add("responseHeader", new SimpleOrderedMap());
+        rsp.addResponseHeader(new SimpleOrderedMap());
         req = new LocalSolrQueryRequest(core, params);
         handler.handleRequest(req, rsp);
         req.close();

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/JSONWriterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/JSONWriterTest.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/JSONWriterTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/JSONWriterTest.java Mon Dec
21 14:39:21 2015
@@ -124,7 +124,7 @@ public class JSONWriterTest extends Solr
     list.setMaxScore(0.7f);
     list.add(solrDoc);
 
-    rsp.add("response", list);
+    rsp.addResponse(list);
 
     w.write(buf, req, rsp);
     String result = buf.toString();

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/SmileWriterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/SmileWriterTest.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/SmileWriterTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/SmileWriterTest.java Mon Dec
21 14:39:21 2015
@@ -130,7 +130,7 @@ public class SmileWriterTest extends Sol
     list.setMaxScore(0.7f);
     list.add(solrDoc);
 
-    rsp.add("response", list);
+    rsp.addResponse(list);
 
     w.write(buf, req, rsp);
 

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/response/TestCSVResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/response/TestCSVResponseWriter.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/response/TestCSVResponseWriter.java
(original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/response/TestCSVResponseWriter.java
Mon Dec 21 14:39:21 2015
@@ -143,7 +143,7 @@ public class TestCSVResponseWriter exten
     
     SolrQueryRequest req = req("q","*:*");
     SolrQueryResponse rsp = new SolrQueryResponse();
-    rsp.add("response", sdl);
+    rsp.addResponse(sdl);
     QueryResponseWriter w = new CSVResponseWriter();
     
     rsp.setReturnFields( new SolrReturnFields("id,foo_s", req) );

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/response/TestPHPSerializedResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/response/TestPHPSerializedResponseWriter.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/response/TestPHPSerializedResponseWriter.java
(original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/response/TestPHPSerializedResponseWriter.java
Mon Dec 21 14:39:21 2015
@@ -96,7 +96,7 @@ public class TestPHPSerializedResponseWr
     SolrDocumentList sdl = new SolrDocumentList();
     sdl.add(d1);
     sdl.add(d2);
-    rsp.add("response", sdl); 
+    rsp.addResponse(sdl);
     
     w.write(buf, req, rsp);
     assertEquals("a:1:{s:8:\"response\";a:3:{s:8:\"numFound\";i:0;s:5:\"start\";i:0;s:4:\"docs\";a:2:{i:0;a:6:{s:2:\"id\";s:1:\"1\";s:5:\"data1\";s:5:\"hello\";s:5:\"data2\";i:42;s:5:\"data3\";b:1;s:5:\"data4\";a:2:{s:7:\"data4.1\";s:7:\"hashmap\";s:7:\"data4.2\";s:5:\"hello\";}s:5:\"data5\";a:3:{i:0;s:7:\"data5.1\";i:1;s:7:\"data5.2\";i:2;s:7:\"data5.3\";}}i:1;a:1:{s:2:\"id\";s:1:\"2\";}}}}",


Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java Mon Dec
21 14:39:21 2015
@@ -259,8 +259,8 @@ public class TestRangeQuery extends Solr
         SolrQueryResponse qr = h.queryAndResponse(handler, req);
         if (last != null) {
           // we only test if the same docs matched since some queries will include factors
like idf, etc.
-          DocList rA = ((ResultContext)qr.getValues().get("response")).getDocList();
-          DocList rB = ((ResultContext)last.getValues().get("response")).getDocList();
+          DocList rA = ((ResultContext)qr.getResponse()).getDocList();
+          DocList rB = ((ResultContext)last.getResponse()).getDocList();
           sameDocs( rA, rB );
         }
         req.close();

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java
(original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java
Mon Dec 21 14:39:21 2015
@@ -112,7 +112,7 @@ public class SpellCheckCollatorTest exte
     {
       SolrRequestHandler handler = core.getRequestHandler("spellCheckCompRH");
       SolrQueryResponse rsp = new SolrQueryResponse();
-      rsp.add("responseHeader", new SimpleOrderedMap());
+      rsp.addResponseHeader(new SimpleOrderedMap());
       SolrQueryRequest req = new LocalSolrQueryRequest(core, params);
       handler.handleRequest(req, rsp);
       req.close();
@@ -144,7 +144,7 @@ public class SpellCheckCollatorTest exte
     {
       SolrRequestHandler handler = core.getRequestHandler("spellCheckCompRH");
       SolrQueryResponse rsp = new SolrQueryResponse();
-      rsp.add("responseHeader", new SimpleOrderedMap());
+      rsp.addResponseHeader(new SimpleOrderedMap());
       SolrQueryRequest req = new LocalSolrQueryRequest(core, params);
       handler.handleRequest(req, rsp);
       req.close();
@@ -238,7 +238,7 @@ public class SpellCheckCollatorTest exte
     //not want the collations to return us "lowerfilt:(+faith +hope +loaves)" as this only
matches doc id#1.
     SolrRequestHandler handler = core.getRequestHandler("spellCheckCompRH");
     SolrQueryResponse rsp = new SolrQueryResponse();
-    rsp.add("responseHeader", new SimpleOrderedMap());
+    rsp.addResponseHeader(new SimpleOrderedMap());
     SolrQueryRequest req = new LocalSolrQueryRequest(core, params);
     handler.handleRequest(req, rsp);
     req.close();
@@ -273,7 +273,7 @@ public class SpellCheckCollatorTest exte
     //because requrying against this Request Handler results in 0 hits.
     SolrRequestHandler handler = core.getRequestHandler("spellCheckCompRH");
     SolrQueryResponse rsp = new SolrQueryResponse();
-    rsp.add("responseHeader", new SimpleOrderedMap());
+    rsp.addResponseHeader(new SimpleOrderedMap());
     SolrQueryRequest req = new LocalSolrQueryRequest(core, params);
     handler.handleRequest(req, rsp);
     req.close();
@@ -288,7 +288,7 @@ public class SpellCheckCollatorTest exte
     params.remove(SpellingParams.SPELLCHECK_BUILD);
     handler = core.getRequestHandler("spellCheckCompRH1");
     rsp = new SolrQueryResponse();
-    rsp.add("responseHeader", new SimpleOrderedMap());
+    rsp.addResponseHeader(new SimpleOrderedMap());
     req = new LocalSolrQueryRequest(core, params);
     handler.handleRequest(req, rsp);
     req.close();
@@ -320,7 +320,7 @@ public class SpellCheckCollatorTest exte
     // return no results if tried.
     SolrRequestHandler handler = core.getRequestHandler("spellCheckCompRH");
     SolrQueryResponse rsp = new SolrQueryResponse();
-    rsp.add("responseHeader", new SimpleOrderedMap());
+    rsp.addResponseHeader(new SimpleOrderedMap());
     SolrQueryRequest req = new LocalSolrQueryRequest(core, params);
     handler.handleRequest(req, rsp);
     req.close();
@@ -337,7 +337,7 @@ public class SpellCheckCollatorTest exte
     params.add(SpellingParams.SPELLCHECK_MAX_COLLATIONS, "1");
     handler = core.getRequestHandler("spellCheckCompRH");
     rsp = new SolrQueryResponse();
-    rsp.add("responseHeader", new SimpleOrderedMap());
+    rsp.addResponseHeader(new SimpleOrderedMap());
     req = new LocalSolrQueryRequest(core, params);
     handler.handleRequest(req, rsp);
     req.close();
@@ -355,7 +355,7 @@ public class SpellCheckCollatorTest exte
     params.add(SpellingParams.SPELLCHECK_MAX_COLLATIONS, "2");
     handler = core.getRequestHandler("spellCheckCompRH");
     rsp = new SolrQueryResponse();
-    rsp.add("responseHeader", new SimpleOrderedMap());
+    rsp.addResponseHeader(new SimpleOrderedMap());
     req = new LocalSolrQueryRequest(core, params);
     handler.handleRequest(req, rsp);
     req.close();
@@ -374,7 +374,7 @@ public class SpellCheckCollatorTest exte
     params.add(SpellingParams.SPELLCHECK_COLLATE_EXTENDED_RESULTS, "true");
     handler = core.getRequestHandler("spellCheckCompRH");
     rsp = new SolrQueryResponse();
-    rsp.add("responseHeader", new SimpleOrderedMap());
+    rsp.addResponseHeader(new SimpleOrderedMap());
     req = new LocalSolrQueryRequest(core, params);
     handler.handleRequest(req, rsp);
     req.close();
@@ -428,7 +428,7 @@ public class SpellCheckCollatorTest exte
     //not want the collations to return us "lowerfilt:(+faith +hope +loaves)" as this only
matches doc id#1.
     SolrRequestHandler handler = core.getRequestHandler("spellCheckCompRH");
     SolrQueryResponse rsp = new SolrQueryResponse();
-    rsp.add("responseHeader", new SimpleOrderedMap());
+    rsp.addResponseHeader(new SimpleOrderedMap());
     SolrQueryRequest req = new LocalSolrQueryRequest(core, params);
     handler.handleRequest(req, rsp);
     req.close();
@@ -585,7 +585,7 @@ public class SpellCheckCollatorTest exte
     params.add(CommonParams.Q, "lowerfilt:(+fauth)");
     SolrRequestHandler handler = core.getRequestHandler("spellCheckCompRH");
     SolrQueryResponse rsp = new SolrQueryResponse();
-    rsp.add("responseHeader", new SimpleOrderedMap());
+    rsp.addResponseHeader(new SimpleOrderedMap());
     SolrQueryRequest req = new LocalSolrQueryRequest(core, params);
     handler.handleRequest(req, rsp);
     req.close();

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java?rev=1721170&r1=1721169&r2=1721170&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java Mon
Dec 21 14:39:21 2015
@@ -345,7 +345,7 @@ public class DocumentBuilderTest extends
       SolrQueryResponse rsp = new SolrQueryResponse();
       core.execute(core.getRequestHandler(req.getParams().get(CommonParams.QT)), req, rsp);
 
-      DocList dl = ((ResultContext) rsp.getValues().get("response")).getDocList();
+      DocList dl = ((ResultContext) rsp.getResponse()).getDocList();
       assertTrue("can't find the doc we just added", 1 == dl.size());
       int docid = dl.iterator().nextDoc();
 



Mime
View raw message