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


##########
lucene/demo/src/java/org/apache/lucene/demo/facet/RangeFacetsExample.java:
##########
@@ -73,6 +76,35 @@ public void index() throws IOException {
       indexWriter.addDocument(doc);
     }
 
+    // Add documents with a fake timestamp, 3600 sec (1 hour) after "now", 
7200 sec (2
+    // hours) after "now", ...:
+    long startTime = 0;
+    // Index error messages since a week (24 * 7 = 168 hours) ago
+    for (int i = 0; i < 168; i++) {
+      long endTime = startTime + (i + 1) * 3600;
+
+      // Choose a relatively larger number, e,g., "35", in order to create 
variation in count for
+      // the top-n children, so that getTopChildren(10) in the 
searchTopChildren functionality
+      // can return children with different counts
+      for (int j = 0; j < i % 35; j++) {
+        Document doc = new Document();
+        // index document at a different timestamp by using endTime - i * j

Review Comment:
   OK, thank you! I like the idea and I think it's close, but I think we can 
come up with a simpler way. I think you could randomly distribute the "data 
points" within each hour when you index without impacting testing at all. The 
facet counts should remain the same regardless of how the data points are 
distributed, so testing should be stable I think? So maybe we hit a compromise 
that uses a stable number of data points per hour time period (which you could 
do with your modulus operation if you like) but then randomly jitter the data 
within each hour block?
   
   But yeah, let's take it up as a follow on issue. Would you mind linking that 
here once you create it so the conversation is easier to follow for future 
readers? Thanks again for all the hard work!



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