Performing VSS range queries
To understand what range queries are in the context of VSS, an edge case would be searching for two element vectors that model the coordinates of points in a bi-dimensional Cartesian plane. Another example would be geographical locations expressed with longitude and latitude. In these cases, a range query that uses VSS would find closer points in this bi-dimensional space, so within the desired distance from the query vector. Thinking of multi-dimensional spaces, we can imagine the most different use cases. Using VSS range queries, we want to discover relevant content within a predefined similarity range, instead of looking up the KNN similar vectors.
We can customize the example we’ve considered so far and rewrite the search operation as follows:
q = Query("@embedding:[VECTOR_RANGE $radius $vec]=>{$YIELD_DISTANCE_AS: score}") \ Â Â Â Â .sort_by("score") \ Â Â Â Â .return_field("score...