【发布时间】:2019-10-28 07:01:27
【问题描述】:
我在 Firebase 中有一个集合,其中包含多条记录,每条记录都包含一个名称和一组用于记录“关键字”的字符串。下面的例子。
Record_1
name: Record 1
keywords: [apple, orange, raspberry]
Record_2
name: Record 2
keywords: [orange, strawberry, raspberry]
Record_3
name: Record 3
keywords: [apple, pear, strawberry]
//Search String: “I would like an apple and an orange.”
//Returns results: Record_1 and Record_2
我想从文本字段中的用户搜索字符串运行搜索。不幸的是,这个字符串可能包含在任何关键字数组中都不存在的单词。
我想从搜索字符串中返回具有所有匹配关键字的记录,但不是限制是由于数组中搜索字符串中不存在的单词。请参阅上面的示例“搜索字符串”和“返回结果”。
有什么想法吗? 谢谢
【问题讨论】:
标签: javascript firebase google-cloud-firestore