madrob commented on a change in pull request #267:
URL: https://github.com/apache/solr/pull/267#discussion_r696140459
##########
File path:
solr/core/src/test/org/apache/solr/handler/component/MockSortSpecBuilder.java
##########
@@ -0,0 +1,36 @@
+package org.apache.solr.handler.component;
Review comment:
license header
##########
File path:
solr/core/src/test/org/apache/solr/handler/component/MockResponseBuilder.java
##########
@@ -0,0 +1,54 @@
+package org.apache.solr.handler.component;
Review comment:
license header
##########
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:
They do! I am super happy with these, and they help me understand it
much better than I thought I got it before.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]