Follow up to GITHUB#11916, remove deleted docs check (#11919)

This commit is contained in:
Benjamin Trent 2022-11-10 18:40:24 -05:00 committed by GitHub
parent 3a506ec87a
commit c8d44acf20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 13 deletions

View File

@ -2589,7 +2589,6 @@ public final class CheckIndex implements Closeable {
status.totalKnnVectorFields++; status.totalKnnVectorFields++;
int docCount = 0; int docCount = 0;
final Bits bits = reader.getLiveDocs();
int everyNdoc = Math.max(values.size() / 64, 1); int everyNdoc = Math.max(values.size() / 64, 1);
while (values.nextDoc() != NO_MORE_DOCS) { while (values.nextDoc() != NO_MORE_DOCS) {
float[] vectorValue = values.vectorValue(); float[] vectorValue = values.vectorValue();
@ -2598,22 +2597,11 @@ public final class CheckIndex implements Closeable {
TopDocs docs = TopDocs docs =
reader reader
.getVectorReader() .getVectorReader()
.search(fieldInfo.name, vectorValue, 10, bits, Integer.MAX_VALUE); .search(fieldInfo.name, vectorValue, 10, null, Integer.MAX_VALUE);
if (docs.scoreDocs.length == 0) { if (docs.scoreDocs.length == 0) {
throw new CheckIndexException( throw new CheckIndexException(
"Field \"" + fieldInfo.name + "\" failed to search k nearest neighbors"); "Field \"" + fieldInfo.name + "\" failed to search k nearest neighbors");
} }
if (bits != null) {
for (ScoreDoc doc : docs.scoreDocs) {
if (bits.get(doc.doc) == false) {
throw new CheckIndexException(
"Searching Field \""
+ fieldInfo.name
+ "\" matched deleted doc="
+ doc.doc);
}
}
}
} }
int valueLength = vectorValue.length; int valueLength = vectorValue.length;
if (valueLength != dimension) { if (valueLength != dimension) {