algolia 中的统计聚合 [英] Statistics aggregations in algolia
问题描述
我正在浏览 Algolia 的文档,但找不到任何与在 elasticsearch 中进行聚合相关的内容:https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html
I was looking through the documentation for Algolia and could not find anything related to doing aggregations like you can in elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html
我想做的一个例子是:
- 当用户搜索时,我也会实时显示该查询的聚合结果,例如匹配特定过滤器的所有内容的计数(例如所有红色项目、蓝色项目、黄色项目的计数等)
推荐答案
ES 所谓的聚合"实际上是 Algolia 提供的方面"的一个子集(请参阅 https://www.algolia.com/doc/search/filtering-faceting#faceting).您可以使用 term
聚合在 ES 中实现 Algolia 分面功能.
What ES calls "aggregations" is actually a subset of the "facets" that Algolia provides (see https://www.algolia.com/doc/search/filtering-faceting#faceting). The Algolia faceting capabilities is what you can achieve in ES using the term
aggregation.
分面将计算与每个分面值关联的计数,并为您提供过滤这些值的方法.
Faceting will compute the counts associated to each faceted value and provides you a way to filter on those values.
由于 Algolia 已经过高度优化和设计,用于即时全文搜索,因此该引擎不提供深度聚合功能.如果基础构面值为数字,您将获得的唯一聚合是 min
、max
、avg
值.
Since Algolia has been highly optimized and designed for as-you-type full-text search, the engine doesn't provide deep aggregation capabilities. The only aggregation you would get is the min
, max
, avg
values if the underlying facet values are numbers.
这篇关于algolia 中的统计聚合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!