You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT rowid, distance FROM vec_examples
WHERE sample_embedding MATCH '[0.890, 0.544, 0.825, 0.961, 0.358, 0.0196, 0.521, 0.175]'
order by distance
limit 2;
Hello, What does the SQL statement MATCH do in the above example. Where does distance come from, Does it calculate the Euclidean distance?
The text was updated successfully, but these errors were encountered:
SELECT rowid, distance FROM vec_examples WHERE sample_embedding MATCH '[0.890, 0.544, 0.825, 0.961, 0.358, 0.0196, 0.521, 0.175]' order by distance limit 2;
Hello, What does the SQL statement MATCH do in the above example. Where does distance come from, Does it calculate the Euclidean distance?
I asked @asg017 over discord and here is the answer:
by default it's L2 distance, can be configured to something else with distance_metric:
create virtual table vec_items using vec0(
contents_embedding float[768] distance_metric=cosine
)
SELECT rowid, distance FROM vec_examples
WHERE sample_embedding MATCH '[0.890, 0.544, 0.825, 0.961, 0.358, 0.0196, 0.521, 0.175]'
order by distance
limit 2;
Hello, What does the SQL statement MATCH do in the above example. Where does distance come from, Does it calculate the Euclidean distance?
The text was updated successfully, but these errors were encountered: