I see that Firestore backend libraries have a findNearest
query in a collection, but I can't find the same option in the client-side library. Is it possible at all?
I was already able to store the vector values in Firestore with FieldValue.vector
, now I just need a way to query them by proximity.
I see that Firestore backend libraries have a findNearest
query in a collection, but I can't find the same option in the client-side library. Is it possible at all?
I was already able to store the vector values in Firestore with FieldValue.vector
, now I just need a way to query them by proximity.
https://firebase.google.com/docs/firestore/vector-search#make_a_nearest-neighbor_query
The page of documentation that you linked is pretty clear about the limitations of vector embeddings:
Only the Python, Node.js, Go, and Java client libraries support vector search.
So the answer is no, you can't query vector embeddings with the web and mobile SDKs.
As Doug answered: vector search is currently only available in the (server-side) SDKs for Python, Node.js, Go, and Java. It is not currently available in any of the client-side SDKs.
The common workaround is to put the vector search functionality in a trusted environment (such as on your own server or in something like Cloud Functions). Step-by-step: