Use cosine similarity in SQL query for embeddings#344
Use cosine similarity in SQL query for embeddings#344v-dirichards merged 1 commit intoMicrosoftDocs:mainfrom
Conversation
|
@Giorgi : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
|
Learn Build status updates of commit 7985e9f: ✅ Validation status: passed
For more details, please refer to the build report. |
|
Can you review the proposed changes? IMPORTANT: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
|
#assign: @markingmyname |
|
#sign-off |
|
Invalid command: '#sign-off'. Only the assigned author of one or more file in this PR can sign off. @mulander |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the SQL query was using the wrong vector similarity operator. The DiskAnn index is created with vector_cosine_ops for cosine similarity, but the query was incorrectly using the inner product operator.
Changes:
- Changed the vector similarity operator from inner product
<#>to cosine similarity<=>in the ORDER BY clause of the embedding similarity search query
The DiskAnn index is created for
vector_cosine_opsbut the query was using inner product<#>