lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r884417 - /lucene/solr/trunk/src/java/org/apache/solr/request/BaseResponseWriter.java
Date Thu, 26 Nov 2009 06:47:17 GMT
Author: noble
Date: Thu Nov 26 06:47:16 2009
New Revision: 884417

URL: http://svn.apache.org/viewvc?rev=884417&view=rev
Log:
SOLR-1516

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/request/BaseResponseWriter.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/request/BaseResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/request/BaseResponseWriter.java?rev=884417&r1=884416&r2=884417&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/request/BaseResponseWriter.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/request/BaseResponseWriter.java Thu Nov 26
06:47:16 2009
@@ -59,8 +59,6 @@
   private static final Logger LOG = LoggerFactory
       .getLogger(BaseResponseWriter.class);
 
-  private static final String RESPONSE_HEADER = "responseHeader";
-
   private static final String SCORE_FIELD = "score";
 
   /**
@@ -85,7 +83,7 @@
     for (int i = 0; i < nl.size(); i++) {
       String name = nl.getName(i);
       Object val = nl.getVal(i);
-      if (RESPONSE_HEADER.equals(name)) {
+      if ("responseHeader".equals(name)) {
         Boolean omitHeader = request.getParams().getBool(CommonParams.OMIT_HEADER);
         if (omitHeader == null || !omitHeader) responseWriter.writeResponseHeader((NamedList)
val);
       } else if (val instanceof SolrDocumentList) {
@@ -153,9 +151,15 @@
         Set<String> returnFields) {
       this.schema = schema;
       this.searcher = searcher;
-      this.returnFields = returnFields;
       this.includeScore = returnFields != null
-          && returnFields.contains("score");
+              && returnFields.contains(SCORE_FIELD);
+      if (returnFields != null) {
+        if (returnFields.size() == 0 || (returnFields.size() == 1 && includeScore)
|| returnFields.contains("*")) {
+          returnFields = null;  // null means return all stored fields
+        }
+      }
+      this.returnFields = returnFields;
+
     }
   }
 



Mime
View raw message