Best practice Firebase search and query

Viewed 186

Current State

I have a Flutter app which shows me a list of data from Firebase in a list view.

  return new ListView(
      children: snapshot.data.docs.map((DocumentSnapshot documentSnapshot) {
    return _createRows(
      documentSnapshot.data()['id'],
      documentSnapshot.reference.id,
    );
  }).toList());

Problem/Question

But the list will get bigger and therefore the loading times will increase but much more important the usage of the read processes will increase exponentially. I also plan to add a search function.

Firebase docs:

[...] downloading an entire collection to search for fields client-side isn't practical.

Is there a possibility to only query the used data from the ListView.builder and to do the search via Firebase?

(One possibility is shown here. However, this is not too advantageous for data storage use) Also, there are a few third party sites, but I couldn't find any free ones in addition, I'm not sure whether the effort to implement in Flutter is worth it. e.g.elastic

I am curious to hear your suggestions

1 Answers

I decided to download all the data at the start of the app and then pass it around inside the app, as I have comparatively little data to download and a long stay in the app, it is most worthwhile.

I realised the search with the plugin TypeAhead.

Related