angular - Firebase Firestore tie full-text search using external services with built in queries
问题描述
So, I know that in order to do full-text queries for Firestore data you have to use external services such as Algolia and Elasticsearch, which is fine. But my problem is that I don´t know how combine those with the existing querying tools of Firestore such as "where", "limit" and "startAfter".
Basically, I have a page where you can see the 10 most recent posts and then load 10 more by pressing a button and passing the value of the last element until you have reached the end. Like this tutorial >link< but without virtual scrolling.
query.where('active', '==', true).orderBy('createdAt').startAfter(offset).limit(10);
All of this works great, but by using an external service for the additional full-text search I have two different queries that don´t know about each other, defeating the purpose of Firestore´s attempt of providing pagination.
Do I miss something or is there already who has dealt with this problem?
解决方案
The short answer is: you can't. Firestore queries can only consider data in Firestore documents, and nothing else.
If data is being mirrored to another database, that database will have to be queried separately. The code performing the queries can merge the results of multiple queries if needed.
推荐阅读
- ms-access - MS Access VBA 和宏导出
- javascript - 使用 TestCafe Selector 或 testcafe-react-selector 为嵌套组件查找元素节点时遇到问题
- c++ - C++ 无法使用嵌套循环索引数组的元素
- sql - 尽管获得了 GRANT EXECUTE,但我在函数调用中得到“ORA-00904:无效标识符”
- javascript - 需要将客户价值传递回 React 中的 POST 操作
- c++ - gtest 单元测试目标配置文件路径
- xamarin - 无法从“Xamarin.Forms.Entry”转换为“Tweetinvi.Models.IUserIdentifier”
- java - RestTemplate JSON 反序列化
- bash - 从 jenkins 调用的 Minicom 脚本在退出 '! killall -9 minicom'
- hibernate - 强制不在杰克逊中序列化未获取的惰性对象