Closed pasa13142 closed 1 year ago
Hi @pasa13142, you can use:
cur.execute('SELECT embedding <-> %s AS distance FROM item', (embedding,))
cur.fetchall()
Hey, Thanks for the answer! Also, Can I search multi embeddings in one query? I tried like
cursor.execute('SELECT image_id, embedding <-> (%s, %s) AS distance FROM images ORDER BY distance LIMIT 20', (encodes[0],encodes[1]))
cursor.fetchall()
but didnt work. Have any idea?
Hey, thanks !
I've seen it but using 'union all' on the same table didn't make much sense to me. Is there a more effective method that we can do in a single query?
Hey, Thanks for this amazing project.
There is an example about how to get distance by django and SQLAlchemy but Psycopg2. Could you help about how to get the distance by Psycopg 2? Thanks in advance