Measures how far the query vector is from each and every candidate, for instance using VECTOR_DISTANCE with TOP and ORDER BY, so the results are always right. It is advised for up to roughly 50,000 candidates; beyond that, ANN (approximate) search is preferred.
Also called kNN.
Read more: Microsoft Learn
In the Ultra Transcenders books
Each book explains Exact nearest neighbour in context, with comparison tables and the common traps.
Terms in this definition
- ORDER BY
Sorts what a SQL query returns on one or more columns. Leave it out and rows arrive in no guaranteed sequence.
- ANN
Short for approximate nearest neighbour: a vector search that finds most of the closest matches rather than guaranteeing every one, trading completeness for speed and lower cost. DiskANN and HNSW indexes work this way, whereas flat search is exact.
Related terms
- KNN
A vector query returning the K vectors closest to a given one, written in RediSearch as [KNN K @field \$vec].
- Recall
A measure of approximate (ANN) vector search accuracy: what fraction of the true nearest neighbours, as found by an exact kNN search, the approximate search returned. A value of 1 means nothing was approximated.