Google Firestore: Query on substring of a property value (text search)

1,892 views
Skip to first unread message

Ruben Chevez

unread,
May 28, 2019, 10:20:21 AM5/28/19
to Firebase Google Group
I am looking to add a simple search field, would like to use something like

collectionRef.where('name', 'contains', 'searchTerm')

Sam Stern

unread,
May 28, 2019, 12:13:50 PM5/28/19
to Firebase Google Group
Hi Ruben,

Firestore does not have full text search so this is not possible right now.  We recommend that you use an external search service, here's an example: 

Sam


On Tue, May 28, 2019, 4:20 PM Ruben Chevez <rubench...@gmail.com> wrote:
I am looking to add a simple search field, would like to use something like

collectionRef.where('name', 'contains', 'searchTerm')

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/a25f513e-bca0-474d-969b-3215b30a33ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruben Chevez

unread,
May 28, 2019, 2:46:40 PM5/28/19
to Firebase Google Group
Hello Sam,

Do you know any free alternative to Angolia?


On Tuesday, 28 May 2019 13:43:50 UTC-2:30, Samuel Stern wrote:
Hi Ruben,

Firestore does not have full text search so this is not possible right now.  We recommend that you use an external search service, here's an example: 

Sam


On Tue, May 28, 2019, 4:20 PM Ruben Chevez <rubench...@gmail.com> wrote:
I am looking to add a simple search field, would like to use something like

collectionRef.where('name', 'contains', 'searchTerm')

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fireba...@googlegroups.com.

Peter C

unread,
May 28, 2019, 2:46:40 PM5/28/19
to Firebase Google Group
If you’re not looking for a full text search (which I believe is a huge downside to firestore that it doesn’t come out of the box) then you can also use indexing with

collectionRef.where('name', “>=“, 'searchTerm')
Reply all
Reply to author
Forward
0 new messages