Text search in Firebase

2,724 views
Skip to first unread message

Mariano Vicario

unread,
Jul 6, 2016, 2:43:57 PM7/6/16
to Firebase Google Group
Hi,
       is there any way to make text search in FireBase without using a server like https://firebase.googleblog.com/2014/01/queries-part-2-advanced-searches-with.html  ?

I can believe that Google (the best search engine), does not have a solution to this. If there is not other way? what solution would you recommend that is the effortless to maintain?

Regards,
Mariano

Kato Richardson

unread,
Jul 6, 2016, 3:24:12 PM7/6/16
to Firebase Google Group
Hi Mariano,

Part 1 of that article covers several search methods for handling starts with, ends with, and other search criteria.

As a company that understands search, we're also a company that understands using the best tool for the job. For fuzzy matching and contains, a NoSQL, realtime data store isn't the correct tool--these queries would be slow and scale poorly.  BigQuery or ElasticSearch are the right tool for providing useful results in a scalable and robust manner.

Right now, this involves deploying a small node script to sync your search results with the realtime data, as explained in the article with the sample Flashlight lib. In the future, it will become more "effortless" as we add integrations between Firebase and Cloud products, particularly Cloud Functions and BigQuery interoperability.

☼, Kato

--
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/5166ff2e-196e-4950-9383-acc1327f0d91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Hideki Yamamoto

unread,
Jul 24, 2016, 12:50:44 PM7/24/16
to Firebase Google Group
There you go, my current partially working demo

Hideki Yamamoto

unread,
Jul 25, 2016, 1:03:07 AM7/25/16
to Firebase Google Group

The mentioned metaschema app is based on my library oxyzen(https://github.com/metaschema/oxyzen).


On Wednesday, July 6, 2016 at 8:43:57 PM UTC+2, Mariano Vicario wrote:

Hideki Yamamoto

unread,
Jul 25, 2016, 1:03:08 AM7/25/16
to Firebase Google Group
One possible answer is to somehow wrap inserts and updates in a function that basically ACTUALLY DO INDEX the objects.
This will basically go into every property of an object and extact the relevant text, (for example excluding html markup), and also somehow normalizes it, for example stange symbols are removed, words are spaced from symbols and so on
then the text is indexed in different ways:
the WORD index stores in a firebase collections the id and collection of every object inserted that has the specified word
the HASHEDWORD index stores in a firebase collections the id and collection of every object inserted that has a hashtag
... and other ways could be implemented as well.
then the object is inserted/updated in the actual firebase collection.

Then the search mechanism is easy and it's based on text equality bewteen input key in the index,
 then get the matching records, because they are the object itself of the very key.

SOURCE https://github.com/metaschema/metaschema - the relevant code is in the firebase-oxygen.js file.

Sorry for previous reply too short.



On Wednesday, July 6, 2016 at 8:43:57 PM UTC+2, Mariano Vicario wrote:

Christian Genco

unread,
Jul 28, 2017, 7:40:14 PM7/28/17
to Firebase Google Group
It looks like Google's new way of doing this is by plugging in either algolia or BigQuery to firebase with firebase cloud functions.



Algolia is a web service custom made for searching, so if you're just trying to implement full text search I'd go with that. BigQuery is for more things under the "analytics" umbrella.
Reply all
Reply to author
Forward
0 new messages