pgvector.git / summary / log / commit / refs
commit 31a007933c4bf3dbe01ff84c1fcd64a84904757d
Author: Andrew Kane <andrew@ankane.org>
Date: Sun Apr 14 15:40:27 2024 +0000
Updated readme [skip ci]
README.md | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 017519db..5118da09 100644
--- a/README.md
+++ b/README.md
@@ -138,6 +138,12 @@ Get the nearest neighbors to a vector
SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;
```
+Supported distance functions are:
+
+- `<->` - L2 distance
+- `<#>` - (negative) inner product
+- `<=>` - cosine distance
+
Get the nearest neighbors to a row
```sql
@@ -509,7 +515,7 @@ Insert vectors
INSERT INTO items (embedding) VALUES ('{1:1,3:2,5:3}/5'), ('{1:4,3:5,5:6}/5');
```
-Note: The format is `{index1:value1,index2:value2,...}/dimensions` and indices start at 1 like SQL arrays
+The format is `{index1:value1,index2:value2}/dimensions` and indices start at 1 like SQL arrays
Get the nearest neighbors by L2 distance
[parent: 0c9ad67a1c0c]