wjp719 commented on a change in pull request #731: URL: https://github.com/apache/lucene/pull/731#discussion_r836366205
########## File path: lucene/sandbox/src/java/org/apache/lucene/sandbox/search/MultiRangeQuery.java ########## @@ -314,6 +370,32 @@ public Scorer scorer(LeafReaderContext context) throws IOException { public boolean isCacheable(LeafReaderContext ctx) { return true; } + + @Override + public int count(LeafReaderContext context) throws IOException { + if (numDims != 1) { Review comment: done ########## File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestMultiRangeQueries.java ########## @@ -761,4 +764,67 @@ public void testEqualsAndHashCode() { assertNotEquals(query1.hashCode(), query3.hashCode()); } } + + public void testRewrite() throws IOException { Review comment: done ########## File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestMultiRangeQueries.java ########## @@ -761,4 +764,67 @@ public void testEqualsAndHashCode() { assertNotEquals(query1.hashCode(), query3.hashCode()); } } + + public void testRewrite() throws IOException { + LongPointMultiRangeBuilder builder = new LongPointMultiRangeBuilder("ff", 1); + builder.add(new long[] {2}, new long[] {3}); + builder.add(new long[] {3}, new long[] {4}); + builder.add(new long[] {1}, new long[] {5}); + builder.add(new long[] {8}, new long[] {10}); + builder.add(new long[] {3}, new long[] {3}); + builder.add(new long[] {1}, new long[] {6}); + MultiRangeQuery multiRangeQuery = builder.build(); + Query query = multiRangeQuery.rewrite(null); + Assert.assertNotEquals(query, multiRangeQuery); Review comment: done ########## File path: lucene/sandbox/src/java/org/apache/lucene/sandbox/search/MultiRangeQuery.java ########## @@ -163,6 +165,60 @@ public void visit(QueryVisitor visitor) { } } + @Override + public Query rewrite(IndexReader reader) throws IOException { 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