Skip to content

Apache Lucene open-source search software

Code comment only change

Erick Erickson0767a9d4d7d2
diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByArrayDV.java b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByArrayDV.java
index 4a0d13e2fa3..dfd1bc18e18 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByArrayDV.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByArrayDV.java
@@ -324,6 +324,8 @@ class FacetFieldProcessorByArrayDV extends FacetFieldProcessorByArray {
int ord = (toGlobal != null && segOrd >= 0) ? (int)toGlobal.get(segOrd) : segOrd;
int arrIdx = ord - startTermIndex;
+ // This code handles faceting prefixes, which narrows the range of ords we want to collect.
+ // It’s not an error for an ord to fall outside this range… we simply want to skip it.
if (arrIdx >= 0 && arrIdx < nTerms) {
countAcc.incrementCount(arrIdx, 1);
if (collectAcc != null) {