mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-03 11:10:56 +08:00
Added tests for operators [skip ci]
This commit is contained in:
@@ -186,6 +186,12 @@ SELECT inner_product('{1:1,3:3,5:5}/5'::sparsevec, '{2:4,3:6,4:8}/5');
|
||||
18
|
||||
(1 row)
|
||||
|
||||
SELECT '{1:1,2:2}/2'::sparsevec <#> '{1:3,2:4}/2';
|
||||
?column?
|
||||
----------
|
||||
-11
|
||||
(1 row)
|
||||
|
||||
SELECT cosine_distance('{1:1,2:2}/2'::sparsevec, '{1:2,2:4}/2');
|
||||
cosine_distance
|
||||
-----------------
|
||||
@@ -248,6 +254,12 @@ SELECT cosine_distance('{}/1'::sparsevec, '{}/1');
|
||||
NaN
|
||||
(1 row)
|
||||
|
||||
SELECT '{1:1,2:2}/2'::sparsevec <=> '{1:2,2:4}/2';
|
||||
?column?
|
||||
----------
|
||||
0
|
||||
(1 row)
|
||||
|
||||
SELECT l1_distance('{}/2'::sparsevec, '{1:3,2:4}/2');
|
||||
l1_distance
|
||||
-------------
|
||||
|
||||
Reference in New Issue
Block a user