wjp719 commented on a change in pull request #731: URL: https://github.com/apache/lucene/pull/731#discussion_r838428748
########## File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestMultiRangeQueries.java ########## @@ -761,4 +763,90 @@ public void testEqualsAndHashCode() { assertNotEquals(query1.hashCode(), query3.hashCode()); } } + + private void addRandomDocs(RandomIndexWriter w) throws IOException { + Random random = random(); + for (int i = 0; i < random.nextInt(100, 500); i++) { Review comment: done ########## File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestMultiRangeQueries.java ########## @@ -761,4 +763,90 @@ public void testEqualsAndHashCode() { assertNotEquals(query1.hashCode(), query3.hashCode()); } } + + private void addRandomDocs(RandomIndexWriter w) throws IOException { + Random random = random(); + for (int i = 0; i < random.nextInt(100, 500); i++) { + int numPoints = RandomNumbers.randomIntBetween(random(), 1, 200); + long value = RandomNumbers.randomLongBetween(random(), 0, 2000); + for (int j = 0; j < numPoints; j++) { + Document doc = new Document(); + doc.add(new LongPoint("point", value)); + w.addDocument(doc); + } + } + w.flush(); + w.forceMerge(1); + } + + /** The hit doc count of the rewritten query should be the same as origin query's */ + public void testRandomRewrite() throws IOException { + Directory dir = newDirectory(); + RandomIndexWriter w = new RandomIndexWriter(random(), dir); + int dims = 1; + addRandomDocs(w); + Random random = random(); + + IndexReader reader = w.getReader(); + IndexSearcher searcher = newSearcher(reader); + int numIters = random.nextInt(200); Review comment: done -- 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