How to Search Across Two Collections with Algolia in FlutterFlow?

Database & APIs

Hi everyone,

I'm working on a food delivery app using FlutterFlow and integrating Algolia for search functionality. I have two collections, "Restaurants" and "Items," and I want users to search across both collections simultaneously.

Here’s the setup:

  1. Data from Firebase is successfully synced with Algolia.

  2. I want to implement a search field where a user’s query will search both the "Restaurants" and "Items" collections and return results from both.

What I've tried:

  • Recording 2024-10-04 184147.mp4
    42.89MB

Problem:
When a user types in the first text field, only the first collection (Restaurants) is searched. The second query (Items) doesn't trigger unless I manually type in the second text field. I need both collections to be queried simultaneously based on the input from the first text field.

Question:
How can I properly implement a search that queries two different Algolia collections and returns results from both in one action? Is there a way to combine or chain two Algolia searches, or any other workaround?

Thanks in advance for any help!

What have you tried so far?
  • I set up two separate Algolia search actions on the same search text field in FlutterFlow, but it didn’t work due to FlutterFlow’s restrictions on multiple actions.

  • I also tried creating two separate text fields: the second text field mirrors the first one’s value, but the search only triggers for the first field. The second query doesn’t run unless I manually type into the second text field.

Did you check FlutterFlow's Documentation for this topic?
No
6
1 reply