mayya-sharipova commented on a change in pull request #616:
URL: https://github.com/apache/lucene/pull/616#discussion_r792527437
##########
File path:
lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
##########
@@ -1278,6 +1294,37 @@ public void searchIndex(Directory dir, String oldName,
int minIndexMajorVersion)
34,
searcher.getIndexReader());
+ // test vector values and KNN search
+ if (minIndexMajorVersion >= KNN_VECTOR_MIN_SUPPORTED_VERSION) {
+ // test vector values
+ int cnt = 0;
+ for (LeafReaderContext ctx : reader.leaves()) {
+ VectorValues values = ctx.reader().getVectorValues(KNN_VECTOR_FIELD);
+ if (values != null) {
+ assertEquals(KNN_VECTOR_FIELD_TYPE.vectorDimension(),
values.dimension());
+ for (int doc = values.nextDoc(); doc != NO_MORE_DOCS; doc =
values.nextDoc()) {
+ float[] expectedVector = {0.1f, 0.1f, 0.1f + cnt};
+ assertArrayEquals(
+ "vectors do not match for doc=" + cnt, expectedVector,
values.vectorValue(), 1e-4f);
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]