How to apply static filter

Hello,

In my project, I am trying to filter the database to find the 5 most liked (# likes are a property of each record) events and display them. I was wondering if there was a simple way of doing this since it seems like it would be a common practice.

Hi there! Welcome to the forum @lij4505!

To retrieve the 5 most liked records we would advise to sort your Algolia index by likes and then set hitsPerPage to 5.

You can find a guide on how to sort by a particular attribute here: https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/

Hope this helps!