Skip to content

Commit dea4223

Browse files
committed
dev: better select query
1 parent df39965 commit dea4223

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rig-postgres/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ impl<E: EmbeddingModel + Sync, T: PostgresVectorStoreTable> VectorStoreIndex
292292
.join(", ");
293293

294294
let query_string = format!(
295-
"SELECT {}, embeddings <=> $1 AS distance FROM {} ORDER BY embeddings <=> $1 LIMIT $2",
295+
"SELECT {}, embeddings <=> $1 AS distance FROM {} ORDER BY distance LIMIT $2",
296296
column_names, table_name
297297
);
298298
let rows = self

0 commit comments

Comments
 (0)