在搜索数百万项时,Azure 搜索 return 是否正确计算分面数

Does Azure search return correct counts in facets when searching over millions of items

我问的原因 - 当我们搜索 1-300 万+ 数据项 (~50GB) 时,我们使用的 Algolia 无法 return 更正方面的数字。 Algolia 技术人员证实了这一点 -> 他们正在优化检索时间,因此更喜欢 return 较少的数据,但计数不正确但速度很快。他们主要关注 FTS。

只想确认 Azure 搜索的方法是什么 - 我们可以依赖它吗?还是我们应该自己创建分面?

主要是案例很简单 - 电子商务应用程序(网上商店)有大量的商品 (SKU) 可供销售,我们希望提供通过 Facets 过滤进行搜索的能力。

Azure 搜索不保证准确的分面计数,除非您请求的计数大于或等于分面字段中的唯一值数。例如,如果您有一个包含 10 个唯一值的 category 字段,这可能 return 不准确计数:

GET /indexes/myindex/docs?facet=category,count:3&api-version=2016-09-01

虽然这将 return 准确计数:

GET /indexes/myindex/docs?facet=category,count:10&api-version=2016-09-01

但是,对于具有许多唯一值的字段,为 count 使用较大的值可能会对性能产生负面影响。

这是来自 official docs on Azure Search facets:

Note that if the count parameter is less than the number of unique terms, the results may not be accurate. This is due to the way faceting queries are distributed across shards. Increasing count generally increases the accuracy of term counts, but at a performance cost.

还有一个 discussion on the MSDN forums 关于分面计数准确性的问题,您可能会感兴趣。