Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase 使用多字段firestore进行搜索_Firebase_Flutter_Google Cloud Firestore_Full Text Search_Algolia - Fatal编程技术网

Firebase 使用多字段firestore进行搜索

Firebase 使用多字段firestore进行搜索,firebase,flutter,google-cloud-firestore,full-text-search,algolia,Firebase,Flutter,Google Cloud Firestore,Full Text Search,Algolia,我收集了一些地方: PLaces: doc1: title: "Paris" category: "Pharmacy" city: "Paris" doc2: title: "Paris" category: "Pharmacy city: "New york" doc3: title: "Paris" category: "School city: "New york" 如果我想搜索这个

我收集了一些地方:

PLaces:
  doc1:
   title:    "Paris"
   category: "Pharmacy"
   city:      "Paris"
 doc2:
   title:     "Paris"
   category:   "Pharmacy
   city: "New york"

  doc3:
   title:     "Paris"
   category:   "School
   city: "New york"
如果我想搜索这个名字包含巴黎的地方,我会做以下操作:

>  db.collection('places')
>     .orderBy('title')
>     .startAt(['Paris']).endAt(['Paris'+ '\uf8ff']).getDocuements();
这会让我看到所有有巴黎这个名字的地方

但是,我怎样才能用其他条件搜索位置,如

只需获取名为paris的药房或巴黎市的药房,知道有一个输入字段允许写入搜索关键字

输入搜索示例:

“巴黎药房” “巴黎-纽约药房”
这在云Firestore中可能吗?如果没有,是否有其他方法可以执行此操作?

如果您询问是否可以接受单个字符串并使用它跨字段搜索,则不可能。Firestore不是文本搜索引擎

可以跨字段查询的唯一方法是使用文档中所述的。您必须调用每个要匹配的字段,并且每个查询只能有一个范围筛选器,因此不能对多个字段使用startAt/EndAt。您需要使用字段的精确值来过滤结果


如果您需要全文搜索,文档建议。

谢谢您的评论。对于这个问题,您有什么建议?firestore数据库没有办法做到这一点?我就是这么说的。我在答复中提出了我的建议。