diff --git a/thirdparty/DiskANN/src/pq_flash_index.cpp b/thirdparty/DiskANN/src/pq_flash_index.cpp index ed169528d..ee0c9c670 100644 --- a/thirdparty/DiskANN/src/pq_flash_index.cpp +++ b/thirdparty/DiskANN/src/pq_flash_index.cpp @@ -1452,7 +1452,7 @@ namespace diskann { } } } - if (k_search > 0) { + if (k_search > 0 && indices[0] != -1) { lru_cache.put(vec_hash, indices[0]); }