Skip to content
Snippets Groups Projects
Unverified Commit e74fe883 authored by JT-Dev-215's avatar JT-Dev-215 Committed by GitHub
Browse files

fix: change <-> to <=> in the SELECT query (#804)


Co-authored-by: default avatarAlex Yang <himself65@outlook.com>
parent f1862cca
Branches
Tags
No related merge requests found
---
"llamaindex": patch
---
fix: change <-> to <=> in the SELECT query
......@@ -250,7 +250,7 @@ export class PGVectorStore implements VectorStore {
options?: any,
): Promise<VectorStoreQueryResult> {
// TODO QUERY TYPES:
// Distance: SELECT embedding <-> $1 AS distance FROM items;
// Distance: SELECT embedding <=> $1 AS distance FROM items;
// Inner Product: SELECT (embedding <#> $1) * -1 AS inner_product FROM items;
// Cosine Sim: SELECT 1 - (embedding <=> $1) AS cosine_similarity FROM items;
......@@ -273,7 +273,7 @@ export class PGVectorStore implements VectorStore {
const sql = `SELECT
v.*,
embeddings <-> $1 s
embeddings <=> $1 s
FROM ${this.schemaName}.${this.tableName} v
${where}
ORDER BY s
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment