risdenk commented on code in PR #1025:
URL: https://github.com/apache/solr/pull/1025#discussion_r974529403


##########
solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java:
##########
@@ -862,6 +839,42 @@ private void countFacets(ResponseBuilder rb, ShardRequest 
sreq) {
     removeQueryFacetsUnderLimits(rb);
   }
 
+  private static NamedList<?> getFacetCountsFromShardResponse(
+      ResponseBuilder rb, ShardResponse srsp) {
+    NamedList<?> facet_counts;
+    try {
+      SolrResponse solrResponse = srsp.getSolrResponse();
+      NamedList<Object> response = solrResponse.getResponse();
+      facet_counts = (NamedList<?>) response.get(FACET_COUNTS_KEY);
+      if (facet_counts != null) {
+        return facet_counts;
+      } else {
+        NamedList<?> responseHeader =
+            (NamedList<?>) response.get(SolrQueryResponse.RESPONSE_HEADER_KEY);
+        if 
(responseHeader.getBooleanArg(SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY))
 {
+          return null;
+        } else {
+          log.warn("corrupted response on {} : {}", srsp.getShardRequest(), 
solrResponse);
+          throw new SolrException(
+              ErrorCode.SERVER_ERROR,
+              FACET_COUNTS_KEY
+                  + " is absent in response from "
+                  + srsp.getNodeName()
+                  + ", but "
+                  + SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY
+                  + " hasn't been responded");

Review Comment:
   Updated to `" isn't set in the response."`



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

Reply via email to