Search
Get the nearest 5 neighbors to a vector
Get the nearest 5 neighbors to a vector
Operators
These operators are used for distance metrics:
| Name | Description |
|---|---|
| <-> | squared Euclidean distance |
| <#> | negative dot product |
| <=> | cosine distance |
For their definitions, see overview.
Filter
For a given category, get the nearest 10 neighbors to a vector
Query options
Set ivf scan lists to 1 in session:
Set hnsw search scope to 40 in transaction:
For all options, refer to search options.
Search modes
There are two search modes: vbase and basic.
vbase
As the default search mode, vbase is suitable for most scenarios.
For how it works, refer to the thesis VBASE: Unifying Online Vector Similarity Search and Relational Queries via Relaxed Monotonicity.
basic
basic is behaviorally consistent with vector algorithm libraries such as faiss.
It will be useful if you want to align them.
Enabling basic, you must respect these restrictions:
- Execute VACUUM after updates before searches.
- Search without filter