Yuti-G commented on code in PR #974: URL: https://github.com/apache/lucene/pull/974#discussion_r918297532
########## 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: I've created a spin off [issue](https://issues.apache.org/jira/browse/LUCENE-10652) to add a get top-n range faceting example to demo. Thanks again for reviewing my pr and left all the detailed and constructive feedback! -- 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