Ad

How To Filter On A Long Text Just One Word Via Firestore On Ionic 4?

I'm trying to filter using (ionChange) on a searchbar just for a word on a long text (body of a letter) using Firestore, but the problem I don't know how to start, cannot see any option using Firestore (The filter is not about <=, ==...)

I was googleing a lot but didn't find any solution. Any idea?

Just what i want is to filter a list of ion-card (retrieved from firestore) just a word from a long text. Thank you so much

Ad

Answer

Unfortunately, Firestore does not support full-text search. So there is currently no way you can search a single word in a very long text. According to the official documentation regarding full-text search in Firestore:

To enable full text search of your Cloud Firestore data, use a third-party search service like Algolia.

If the those words that you want to search can be considered "tags", then store those tags in an array and use array-contains option.

Ad
source: stackoverflow.com
Ad