Skip to content

Commit

Permalink
quick and dirty hack fixing double-quoting in filters
Browse files Browse the repository at this point in the history
  • Loading branch information
dredozubov committed Nov 27, 2024
1 parent eefd9c1 commit 1a9afdc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/vectorstore/pgvector/pgvector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ impl VectorStore for Store {
let filter = self.get_filters(opt)?;
let mut where_querys = filter
.iter()
.map(|(k, v)| format!("(data.cmetadata ->> '{}') = '{}'", k, v))
.map(|(k, v)| {
format!(
"(data.cmetadata ->> '{}') = '{}'",
k,
v.to_string().trim_matches('"')
)
})
.collect::<Vec<String>>()
.join(" AND ");

Expand Down

0 comments on commit 1a9afdc

Please sign in to comment.