Fireship · @fireship

Fullstack Autocomplete Search with Algolia

Uploaded August 26, 2019 · Length 12:14

Fullstack Autocomplete Search with Algolia

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.

  1. 0:00

    today we'll turn you our firestore

  2. 0:01

    database into a full-text search engine

  3. 0:03

    using algo leo

  4. 0:04

    it's pointing something it's one of my

  5. 0:11

    all-time favorite API s and I use it on

  6. 0:13

    fire ship IO to power content discovery

  7. 0:15

    features like Instant Search what you'll

  8. 0:17

    build today is a pipeline with firebase

  9. 0:19

    cloud functions that automatically

  10. 0:21

    indexes your fire store data in algo Lea

  11. 0:23

    and then we'll look at multiple

  12. 0:25

    implementations to consume that data

  13. 0:26

    from a customer facing app if you're new

  14. 0:28

    here like and subscribe and check out

  15. 0:30

    the full source code at fire ship IO so

  16. 0:33

    let's start by answering the question of

  17. 0:34

    when would you want to use a service

  18. 0:36

    like algo Lea and keep in mind this

  19. 0:38

    video is not sponsored so these are my

  20. 0:39

    own personal opinions no SQL databases

  21. 0:48

    like fire store are designed primarily

  22. 0:50

    for fast reads and to scale seamlessly

  23. 0:53

    but they can be relatively limited on

  24. 0:55

    the types of queries you can make

  25. 0:56

    especially if you need to search across

  26. 0:58

    the entire text of a document or if you

  27. 1:00

    need to filter by multiple properties

  28. 1:01

    simultaneously and keep track of counts

  29. 1:03

    of different properties algo Lea solves

  30. 1:05

    all of these problems for you and more

  31. 1:07

    it's really an ideal solution if you

  32. 1:09

    have something like Amazon where you

  33. 1:11

    have millions of products and you need

  34. 1:12

    to sort these products and filter and

  35. 1:14

    search them in many complex ways now

  36. 1:17

    algo Lea starts off with a free tier but

  37. 1:19

    one of the biggest complaints you might

  38. 1:21

    hear is that it's expensive and I do

  39. 1:22

    think that's a very valid complaint

  40. 1:24

    especially if you have millions of

  41. 1:25

    Records it jumps from free to $29 per

  42. 1:28

    month up to $500 per month but as you'll

  43. 1:30

    see in this video this is kind of a

  44. 1:32

    situation where you get what you pay for

  45. 1:34

    the first thing you want to do is sign

  46. 1:36

    up for an algo Lea account and then it

  47. 1:38

    will walk you through the process of

  48. 1:39

    creating an index I'll go ahead and

  49. 1:41

    create a new index called customers and

  50. 1:42

    this will basically be a mirror of our

  51. 1:44

    fire store data - any personally

  52. 1:46

    identifiable information things like

  53. 1:48

    email addresses and phone numbers are

  54. 1:50

    not something that you want to keep in

  55. 1:51

    the index you should keep in mind that

  56. 1:53

    all this data will be exposed

  57. 1:54

    client-side so you want to leave out any

  58. 1:56

    information that would be considered

  59. 1:58

    sensitive so now that we have this index