Fireship · @fireship
Fullstack Autocomplete Search with Algolia
Uploaded August 26, 2019 · Length 12:14
Summary
build a full-text search engine using algolia with firebase cloud functions and firestore
- algolia
- firebase cloud functions
- firestore
- full-text search
- autocomplete search
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
today we'll turn you our firestore
- 0:01
database into a full-text search engine
- 0:03
using algo leo
- 0:04
it's pointing something it's one of my
- 0:11
all-time favorite API s and I use it on
- 0:13
fire ship IO to power content discovery
- 0:15
features like Instant Search what you'll
- 0:17
build today is a pipeline with firebase
- 0:19
cloud functions that automatically
- 0:21
indexes your fire store data in algo Lea
- 0:23
and then we'll look at multiple
- 0:25
implementations to consume that data
- 0:26
from a customer facing app if you're new
- 0:28
here like and subscribe and check out
- 0:30
the full source code at fire ship IO so
- 0:33
let's start by answering the question of
- 0:34
when would you want to use a service
- 0:36
like algo Lea and keep in mind this
- 0:38
video is not sponsored so these are my
- 0:39
own personal opinions no SQL databases
- 0:48
like fire store are designed primarily
- 0:50
for fast reads and to scale seamlessly
- 0:53
but they can be relatively limited on
- 0:55
the types of queries you can make
- 0:56
especially if you need to search across
- 0:58
the entire text of a document or if you
- 1:00
need to filter by multiple properties
- 1:01
simultaneously and keep track of counts
- 1:03
of different properties algo Lea solves
- 1:05
all of these problems for you and more
- 1:07
it's really an ideal solution if you
- 1:09
have something like Amazon where you
- 1:11
have millions of products and you need
- 1:12
to sort these products and filter and
- 1:14
search them in many complex ways now
- 1:17
algo Lea starts off with a free tier but
- 1:19
one of the biggest complaints you might
- 1:21
hear is that it's expensive and I do
- 1:22
think that's a very valid complaint
- 1:24
especially if you have millions of
- 1:25
Records it jumps from free to $29 per
- 1:28
month up to $500 per month but as you'll
- 1:30
see in this video this is kind of a
- 1:32
situation where you get what you pay for
- 1:34
the first thing you want to do is sign
- 1:36
up for an algo Lea account and then it
- 1:38
will walk you through the process of
- 1:39
creating an index I'll go ahead and
- 1:41
create a new index called customers and
- 1:42
this will basically be a mirror of our
- 1:44
fire store data - any personally
- 1:46
identifiable information things like
- 1:48
email addresses and phone numbers are
- 1:50
not something that you want to keep in
- 1:51
the index you should keep in mind that
- 1:53
all this data will be exposed
- 1:54
client-side so you want to leave out any
- 1:56
information that would be considered
- 1:58
sensitive so now that we have this index


