Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Statistics aggregations in algolia

Tags:

algolia

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

An example of what I want to do is this:

  • When a user searches, I show in real time the results of an aggregation on that query as well, such as a count of everything matching a particular filter (e.g. count of all the red items, blue items, yellow items etc)
like image 588
Zach Avatar asked Sep 18 '25 18:09

Zach


1 Answers

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.

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.

like image 105
redox Avatar answered Sep 23 '25 13:09

redox