I'm creating a platform to search products based on certain filters. Let's say I have filters A, B and C and a database of around 20,000 products. What I'm trying to build is a way to create a ranking score and query the list of products based on that score. If a product gets a match with filter A, B and C it has a score of 3, therefore, will be visible first in the list with all products of the same score. Then the products with a score of 2. Then 1 and 0.
I'm using Algolia for now using optional_filters but I was wondering if there was a way to build it with a relational database directly like Supabase. Our app is based on Nextjs + Supabase.
Any idea?