Skip to content

Apache Lucene open-source search software

SOLR-5875: QueryComponent.mergeIds() unmarshals all docs' sort field values once per doc instead of once per shard.

Steven Rowe67bc019bd9b1
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 0c18696409a..e95b4b9d8dc 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -186,6 +186,10 @@ Bug Fixes
* SOLR-5550: shards.info is not returned by a short circuited distributed query.
(Timothy Potter, shalin)
+* SOLR-5875: QueryComponent.mergeIds() unmarshals all docs' sort field values once
+ per doc instead of once per shard.
+ (Alexey Serba, hoss, Martin de Vries via Steve Rowe)
+
Optimizations
----------------------
* SOLR-1880: Distributed Search skips GET_FIELDS stage if EXECUTE_QUERY
diff --git a/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java b/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
index 3515c6f4b02..0198c8795c9 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
@@ -904,6 +904,7 @@ public class QueryComponent extends SearchComponent
numFound += docs.getNumFound();
NamedList sortFieldValues = (NamedList)(srsp.getSolrResponse().getResponse().get("sort_values"));
+ NamedList unmarshalledSortFieldValues = unmarshalSortValues(ss, sortFieldValues, schema);
// go through every doc in this response, construct a ShardDoc, and
// put it in the priority queue so it can be ordered.
@@ -940,7 +941,7 @@ public class QueryComponent extends SearchComponent
}
}
- shardDoc.sortFieldValues = unmarshalSortValues(ss, sortFieldValues, schema);
+ shardDoc.sortFieldValues = unmarshalledSortFieldValues;
queue.insertWithOverflow(shardDoc);
} // end for-each-doc-in-response