gsmiller commented on code in PR #974:
URL: https://github.com/apache/lucene/pull/974#discussion_r914082183


##########
lucene/demo/src/java/org/apache/lucene/demo/facet/DistanceFacetsExample.java:
##########
@@ -212,7 +212,26 @@ public static Query getBoundingBoxQuery(
   }
 
   /** User runs a query and counts facets. */
-  public FacetResult search() throws IOException {
+  public FacetResult searchAllChildren() throws IOException {
+
+    FacetsCollector fc = searcher.search(new MatchAllDocsQuery(), new 
FacetsCollectorManager());
+
+    Facets facets =
+        new DoubleRangeFacetCounts(
+            "field",
+            getDistanceValueSource(),
+            fc,
+            getBoundingBoxQuery(ORIGIN_LATITUDE, ORIGIN_LONGITUDE, 10.0),
+            ONE_KM,
+            TWO_KM,
+            FIVE_KM,
+            TEN_KM);
+
+    return facets.getAllChildren("field");
+  }
+
+  /** User runs a query and counts facets. */
+  public FacetResult searchTopChildren() throws IOException {

Review Comment:
   I see. OK, a couple things confused me in your code. It looks like it's 
doing what I describe, but what threw me is that, 1) you're updating a variable 
named `currentTime` to represent the end of each range, and 2) the label says 
"Past ...", which made me thing it was a trailing window. As a couple 
suggestions, maybe rename your `then` and `currentTime` variables to something 
like `startTime` and `endTime`? And maybe rename the labels to just something 
like "Hour x - y"?



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to