admin管理员组文章数量:1418303
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/docs/firestore/vector-search#make_a_nearest-neighbor_query
Share Improve this question asked Jan 29 at 16:20 LeonardoLeonardo 1673 silver badges11 bronze badges2 Answers
Reset to default 2The 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:
- The client writes a vector search request to Firestore
- The server/cloud function triggers
- The server/cloud function performs the actual vector search on Firestore
- The server/cloud function writes the result back Firestore
- The client picks up that response and shows it
本文标签: Firebase JS SDK findNearest function for Firestore Vector searchStack Overflow
版权声明:本文标题:Firebase JS SDK `findNearest` function for Firestore Vector search - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745290826a2651783.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论