Algolia with Firestore for Compound Quering

So I am working on an idea for a “dating app” (I know who would have thought) and searching for what kind of Serverless Service I should use for the BE.

Until now I worked with GCP and Firebase, that’s why I thought I could also use Firestore as my Database.

The problem is, that I would like to do complex filtering like the following:

.where(“date”, “>=”, today).where(“date”, “<=”, today + 3)
.where(“heightMin”, “>=”, 165).where(“heightMax”, “<=”, 185)
.where(“ageMin”, “>=”, 20).where(“ageMax”, “<=”, 30)
.where(“type”, “==”, “running”).where(“smoker”, “==”, false)

In the Cloud Firestore Documentation, it is stated that such compound queries are not possible.

At the same time, I did read, that this might be possible with algolia. If so, which are the keywords I should look at? Is there already some documentation with such filtering examples?

This is how a document could look like:

{
"date": "2022-03-12",
"time": "18:30:00",
"withFilters": "true",
"smoker": "false",
"heightMin": "165",
"heightMax": "165",
"ageMin": "20",
"ageMax":"30",
"type": "running",
"latitude" : "y",
"longitude : "x",
"participants": "2",
}

Hi @geo.sallon

This is a great use case for Algolia. After installing the search extension and getting your data into an Algolia index, you can configure your index to make attributes like smoker, height, and location into facets that you can then use to filter your results using specific values and ranges.

This is a great place to get started:

We also support some geosearch capabilities, but it requires passing geo location data in a particular way: