mayya-sharipova commented on a change in pull request #616:
URL: https://github.com/apache/lucene/pull/616#discussion_r792527794
##########
File path:
lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
##########
@@ -1325,22 +1382,44 @@ public void changeIndexWithAdds(Random random,
Directory dir, Version nameVersio
reader = DirectoryReader.open(dir);
searcher = newSearcher(reader);
+ // make sure searching sees right # hits fot term search
hits = searcher.search(new TermQuery(new Term("content", "aaa")),
1000).scoreDocs;
assertEquals("wrong number of hits", 44, hits.length);
d = searcher.doc(hits[0].doc);
doTestHits(hits, 44, searcher.getIndexReader());
assertEquals("wrong first document", "0", d.get("id"));
+
+ // make sure searching sees right # hits for KNN search
+ if (nameVersion.major >= KNN_VECTOR_MIN_SUPPORTED_VERSION) {
+ float[] queryVector = {0.1f, 0.1f, 0.1f};
+ hits =
+ searcher.search(new KnnVectorQuery(KNN_VECTOR_FIELD, queryVector,
1000), 1000).scoreDocs;
+ assertEquals("wrong number of hits", 44, hits.length);
+ d = searcher.doc(hits[0].doc);
+ assertEquals("wrong first document", "0", d.get("id"));
+ }
reader.close();
}
- public void changeIndexNoAdds(Random random, Directory dir) throws
IOException {
- // make sure searching sees right # hits
+ public void changeIndexNoAdds(Random random, Directory dir, Version
nameVersion)
+ throws IOException {
+ // make sure searching sees right # hits fot term search
Review comment:
Addressed in c93a40f108167e55181084e9b4baba9387eaa795
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]