diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 49544ca3a04..d8041a10ce0 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -310,6 +310,10 @@ New Features (Erik Hatcher, Karl Wettin, Daniel Collins, Nathan Visagan, Ahmet Arslan, Christine Poerschke) +* SOLR-8312: Add domain size and numBuckets to facet telemetry info (facet debug info + for the new Facet Module). (Michael Sun, yonik) + + Bug Fixes ---------------------- diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetField.java b/solr/core/src/java/org/apache/solr/search/facet/FacetField.java index 4378a02b996..f59caeaa5fb 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetField.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetField.java @@ -643,6 +643,9 @@ abstract class FacetFieldProcessorFCBase extends FacetFieldProcessor { } } + FacetDebugInfo fdebug = fcontext.getDebugInfo(); + if (fdebug != null) fdebug.putInfoItem("numBuckets", new Long(numBuckets)); + // if we are deep paging, we don't have to order the highest "offset" counts. int collectCount = Math.max(0, queue.size() - off); assert collectCount <= lim; diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorNumeric.java b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorNumeric.java index 3deed979350..18f71b64091 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorNumeric.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorNumeric.java @@ -393,6 +393,9 @@ class FacetFieldProcessorNumeric extends FacetFieldProcessor { } } + FacetDebugInfo fdebug = fcontext.getDebugInfo(); + if (fdebug != null) fdebug.putInfoItem("numBuckets", new Long(numBuckets)); + if (freq.allBuckets) { SimpleOrderedMap allBuckets = new SimpleOrderedMap<>(); // countAcc.setValues(allBuckets, allBucketsSlot); diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java b/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java index 8d965e79339..793e8676d13 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java @@ -92,6 +92,7 @@ public class FacetModule extends SearchComponent { fproc.process(); long timeElapsed = (long) timer.getTime(); fdebug.setElapse(timeElapsed); + fdebug.putInfoItem("domainSize", (long)fcontext.base.size()); rb.req.getContext().put("FacetDebugInfo", fdebug); } else { fproc.process(); diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java b/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java index f4f03fd5d1b..4b7ed2ce8f2 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java @@ -233,6 +233,7 @@ public class FacetProcessor { subProcessor.process(); long timeElapsed = (long) timer.getTime(); fdebug.setElapse(timeElapsed); + fdebug.putInfoItem("domainSize", (long)subContext.base.size()); } else { subProcessor.process(); }