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



##########
File path: 
solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
##########
@@ -955,9 +955,12 @@ 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<>();
+        }
+        // skip merging results for this shard if the sortSpec includes a 
non-scoredoc field but the sortFieldValues is empty.
+        if (thisResponseIsPartial && sortFieldValues.size() == 0 && 
ss.includesNonScoreOrDocField()) {

Review comment:
       The unmarshalSortValues method just returns an empty list if the sort if 
by score and/or docid and no other field. I could revise the mergeIds method to 
not call it for this case. The only thing that gives me pause is that 
unmarshalSortValues is protected, so presumably its being overridden someplace? 
It doesn't appear to be anywhere in the code base.




-- 
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