Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Using HNSW index requires using Euclidian Distance Operator? #152

Open
john0isaac opened this issue Dec 18, 2024 · 0 comments
Open

Comments

@john0isaac
Copy link
Contributor

Description

You have this comment from the pgvector playgroud repo

# Define HNSW index to support vector similarity search through the vector_l2_ops access method (Euclidean distance). The SQL operator for Euclidean distance is written as <->.

Does it mean that the HNSW index will only work with <-> operator?

Since here in the repo you are using the cosine similarity operator not the <->

SELECT id, RANK () OVER (ORDER BY {self.embedding_column} <=> :embedding) AS rank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant