jtibshirani commented on code in PR #932: URL: https://github.com/apache/lucene/pull/932#discussion_r911682445
########## lucene/core/src/test/org/apache/lucene/util/hnsw/KnnGraphTester.java: ########## @@ -730,4 +794,61 @@ protected int comparePivot(int j) { return Float.compare(score[pivot], score[j]); } } + + private static class SelectiveQuery extends Query { + + public float selectivity = 1f; Review Comment: It would be nice if `SelectiveQuery` created the bit set in the constructor, so all its variables could be immutable. ########## lucene/core/src/test/org/apache/lucene/util/hnsw/KnnGraphTester.java: ########## @@ -730,4 +794,61 @@ protected int comparePivot(int j) { return Float.compare(score[pivot], score[j]); } } + + private static class SelectiveQuery extends Query { + + public float selectivity = 1f; + private FixedBitSet selectedBits; + private long cost; + + @SuppressForbidden(reason = "Uses Math.random()") Review Comment: Since this is in the tests module, you could use `org.apache.lucene.tests.util.LuceneTestCase.random` to avoid the suppression. ########## lucene/core/src/test/org/apache/lucene/util/hnsw/KnnGraphTester.java: ########## @@ -480,11 +537,15 @@ private int[][] getNN(Path docPath, Path queryPath) throws IOException { String hash = Integer.toString(Objects.hash(docPath, queryPath, numDocs, numIters, topK), 36); String nnFileName = "nn-" + hash + ".bin"; Path nnPath = Paths.get(nnFileName); - if (Files.exists(nnPath) && isNewer(nnPath, docPath, queryPath)) { + if (Files.exists(nnPath) Review Comment: Does this mean that we can only compute recall if there is no filter query? Maybe we want to be able to compute recall in this case too? -- 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