k-nearest-neighbour search functionality is a way to find entries based on their distance to a specific vector.
The general function syntax for knn is:
knn(<target column>, <vector to compare with>, <metric> [, <weights>] [, <optimisation term>]).
The optimisation term is useful for improving query performance. It means that an underlying store may return only the
n closest results (i.e. smallest metric).
The term does not guarantee that
n results will be returned, a store can return more results (or less if there are less entries present).
Currently the following metrics are supported:
- L2 squared