makosten commented on a change in pull request #267:
URL: https://github.com/apache/solr/pull/267#discussion_r695288442



##########
File path: 
solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
##########
@@ -955,11 +955,15 @@ protected void mergeIds(ResponseBuilder rb, ShardRequest 
sreq) {
 
         @SuppressWarnings("unchecked")
         NamedList<List<Object>> sortFieldValues = 
(NamedList<List<Object>>)(srsp.getSolrResponse().getResponse().get("sort_values"));
-        if ((null == sortFieldValues || sortFieldValues.size()==0) && // we 
bypass merging this response only if it's partial itself
-                            thisResponseIsPartial) { // but not the previous 
one!!
-          continue; //fsv timeout yields empty sort_vlaues
+        if (null == sortFieldValues) {
+          sortFieldValues = new NamedList<>();
         }
-        NamedList<List<Object>> unmarshalledSortFieldValues = 
unmarshalSortValues(ss, sortFieldValues, schema);
+        boolean needsUnmarshalling = ss.includesNonScoreOrDocField();
+        // skip merging results for this shard if the sortSpec sort values 
need to be marshalled but the sortFieldValues is empty.
+        if (thisResponseIsPartial && sortFieldValues.size() == 0 && 
needsUnmarshalling) {
+          continue;
+        }
+        NamedList<List<Object>> unmarshalledSortFieldValues = 
needsUnmarshalling ? unmarshalSortValues(ss, sortFieldValues, schema) : new 
NamedList<>();

Review comment:
       I added some comments. Hope they help.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to