You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/04/26 07:43:46 UTC

[GitHub] [lucene] jpountz commented on a change in pull request #106: LUCENE-9905: rename VectorValues.SearchStrategy to VectorValues.SimilarityFunction

jpountz commented on a change in pull request #106:
URL: https://github.com/apache/lucene/pull/106#discussion_r620046351



##########
File path: lucene/core/src/java/org/apache/lucene/index/CheckIndex.java
##########
@@ -2336,6 +2338,29 @@ static void checkImpacts(Impacts impacts, int lastTarget) {
                       + docCount
                       + " docs with values");
             }
+            VectorReader vectorReader = reader.getVectorReader();
+            if (vectorReader instanceof Lucene90HnswVectorReader) {
+              KnnGraphValues graphValues =
+                  ((Lucene90HnswVectorReader) vectorReader).getGraphValues(fieldInfo.name);
+              int size = graphValues.size();
+              for (int i = 0; i < size; i++) {
+                graphValues.seek(i);
+                for (int neighbor = graphValues.nextNeighbor();
+                    neighbor != NO_MORE_DOCS;
+                    neighbor = graphValues.nextNeighbor()) {
+                  if (neighbor < 0 || neighbor >= size) {
+                    throw new RuntimeException(
+                        "Field \""
+                            + fieldInfo.name
+                            + "\" has an invalid neighbor ordinal: "
+                            + neighbor
+                            + " which should be in [0,"
+                            + size
+                            + ")");
+                  }
+                }
+              }
+            }

Review comment:
       Codec-specific tests do not feel like a good fit for CheckIndex, should it move to TestLucene90HnswVectorFormat?




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org