Aggregated data for entire index

Hi,

Im using react-instantsearch v.6 and I have gotten a feature request that I am not sure is possible to implement?

I want to achieve below:

Say that my index contains movies and each movie have a duration-property (some numeric value, maybe in seconds). When the user makes a search or filter on movies I wish to display the sum of the duration for the movies that matches the search in the index. Since the data is paginated im wondering if this aggregation/sum feature is possible to implement with algolia?

A backup idea I have is to build an endpoint that browses the entire index with the user input (search, filter etc) and make the calculation myself. However, this would not be ideal since I have to do this on demand by the user (i.e build some type of button that does this processing since I do not wish to browse the entire index on every search)

Any suggestions?

Best Regards,

August

Getting an aggregated time like this is hard to do with an index. Since search results are paginated, you’re correct that doing a browse is going to be the only way to get the full data set to make the calculation directly from the index. The alternative would be to go to the underlying source and doing the query there.