You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"INSERT INTO documents (content, embedding) VALUES ($1, $2)",
31
-
&[&content,&embedding],
29
+
&[&content,&Vector::from(embedding)],
32
30
)?;
33
31
}
34
32
35
-
let document_id = 2;
36
-
for row in client.query("SELECT content FROM documents WHERE id != $1 ORDER BY embedding <=> (SELECT embedding FROM documents WHERE id = $1) LIMIT 5",&[&document_id])? {
33
+
let query = "forest";
34
+
let query_embedding = embed(&[query])?.drain(..).next().unwrap();
35
+
for row in client.query(
36
+
"SELECT content FROM documents ORDER BY embedding <=> $1 LIMIT 5",
0 commit comments