What I like about this project is the order of the work: audit first, then design, then specs, so the client's developer can build without guessing, and that is the process we want to bring to every client.
A Flutter search box that downloads a collection and filters it in Dart pays for every document it filtered. For a 5,000-product catalog on a Standard edition database that is at least 5,000 document reads per load without a cache, and any draft the query could read now sits on a phone whose user was never meant to browse it.
The backend follows from what people type. An order code is an equality query. The first letters of a name are a range query on a normalized field with a hard limit. Words anywhere need a text index: Firestore's own search on an Enterprise edition database, or an external service fed from Firestore.
Two details decide whether it holds. Normalize the stored field and the typed term with one function, because a range query compares UTF-8 bytes and treats Č and c as unrelated. And read the real document before you show a hit, so Security Rules can refuse a draft or deleted item the index still lists.
https://www.duskolicanin.com/blog/flutter-firestore-search-query-boundaries