However, when loading the faiss index and performing an ANN search,
the distances seem to be in descending order. Based on my understanding,
the distances for the nearest neighbour should be in ascending order.
Example:
index = faiss.read_index("autofaiss-full.index")
D, I = index.search(embedding_query_vector, 5)
print(D)
I've been working with an index trained on approximately 3 million 512-dimension embeddings using the following configuration:
Indexing information was reported as follows:
However, when loading the faiss index and performing an ANN search, the distances seem to be in descending order. Based on my understanding, the distances for the nearest neighbour should be in ascending order.
Example:
Output: array([[6.240374 , 6.2014914, 6.2014666, 6.1511683, 6.1026025], ... [8.429452 , 8.385169 , 8.345607 , 8.330268 , 8.313236 ]], dtype=float32)
array([[2833057, 2256886, 1735613, 2845449, 2776100], ... [ 896596, 820252, 1919448, 2013961, 2935604]])
Is this the expected behavior or is there a possible issue with the order of distances returned?