diff --git a/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java b/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java index 8da58e0e87b..cb952f6f405 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java @@ -451,7 +451,7 @@ public class FacetComponent extends SearchComponent long maxCount = sfc.count; for (int shardNum=0; shardNum= fbs.length() || !fbs.get(sfc.termNum))) { // fbs can be null if a shard request failed // if missing from this shard, add the max it could be maxCount += dff.maxPossible(sfc,shardNum); } @@ -466,7 +466,7 @@ public class FacetComponent extends SearchComponent // add a query for each shard missing the term that needs refinement for (int shardNum=0; shardNum0) { + if(fbs!=null && (sfc.termNum >= fbs.length() || !fbs.get(sfc.termNum)) && dff.maxPossible(sfc,shardNum)>0) { dff.needRefinements = true; List lst = dff._toRefine[shardNum]; if (lst == null) {