Skip to content

Commit

Permalink
dev: better select query
Browse files Browse the repository at this point in the history
  • Loading branch information
milancermak committed Jan 3, 2025
1 parent df39965 commit dea4223
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rig-postgres/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ impl<E: EmbeddingModel + Sync, T: PostgresVectorStoreTable> VectorStoreIndex
.join(", ");

let query_string = format!(
"SELECT {}, embeddings <=> $1 AS distance FROM {} ORDER BY embeddings <=> $1 LIMIT $2",
"SELECT {}, embeddings <=> $1 AS distance FROM {} ORDER BY distance LIMIT $2",
column_names, table_name
);
let rows = self
Expand Down

0 comments on commit dea4223

Please sign in to comment.