Simple Search
The simple search allows you to search the data present locally on a device. For example, you could search from the list of strings (stored in a variable) and from the Firestore collection and documents already retrieved on the user's device (displayed on the screen).
We advise using a simple search only for the smaller Firestore collection (with limited records). Otherwise, it can be slow and/or expensive. For a more extensive collection, consider using the Algolia search.
Types of Simple Search
There are three types of search you can add to the page:
- Firestore collection: To search from the Firestore collection.
- Documents: To search from the list of documents stored in a variable.
- Strings: To search from the list of strings stored in a variable such as app or page state variable.
Simple Search [Action]
Follow the steps below to add this action to any widget.
-
Select the Widget (e.g., Button) on which you want to define the action.
-
Select Actions from the Properties Panel (the right menu), and click Open. This will open an Action Flow Editor in a new popup window.
-
Click on the + Add Action.
-
On the right side, search and select the Simple Search action.
-
Select the Search Type among the Firestore Collection, Documents, and Strings.
-
If you select the Firestore Collection:
- Set the Collection to the one that you want to search from.
- Select Searchable Fields to the field that you want to perform the search on.
-
If you select the Documents:
- Set the Source to the variable that holds the list of documents. For example, the result of the query at a top-level widget such as Page or Column
- Select Searchable Fields to the field that you want to perform the search on.
-
If you select the Strings:
- Set the Source to the variable that holds the list of strings (e.g., app or page state variable).
-
Inside the Search Term section, set Widget State > TextField (where users enter a search term).
-