使用 Algolia 进行关系搜索?

Doing relationship searches with Algolia?

我有 Google Firestore + Google 与 Algolia 相关的功能。

我知道您可以同时从 2 个索引执行一个查询。

但是我如何根据来自 2 个索引的条件过滤查询? (意思是不从 2 个索引中过滤 2 个结果,而是根据 2 个索引中的条件从 1 个索引中过滤结果)

这是我的结构的表示:

产品:

{
 objectID: '543j5kh43k5',
 name: 'tomatto',
 storeID: 'kj54h3jk45'
}

店铺:

{
 objectID: 'kj54h3jk45',
 name: 'Walmart',
 geoHash: "9zvxepu69x",
 lat: 44.95515049999999,
 lng: -93.37788669999999
}

我希望能够根据 product namestore location.

进行过滤掉 products 的查询

如果我不能用 Algolia 做到这一点,也许我可以用 Google Cloud Functions 做到这一点?

有什么想法吗?

A​​lgolia 对我来说不是解决方案,因为 Algolia 要求您的所有数据(您希望用于搜索的数据)在编制索引时位于同一个集合中。

我已经转向弹性搜索,有了它,可以在索引时将引用 ID 转换为实际数据。

设置教程: https://medium.com/@acupofjose/wondering-how-to-get-elasticsearch-and-firebases-firestore-to-play-nice-1d84553aa280

图书馆: https://github.com/acupofjose/elasticstore