Previously I did the obvious thing and searched my Postgres database for Posts by title
.
But when you need to scale your search due to a a large dataset, or want to use advanced search features (image/voice/ignore typos, etc), you might want to spin up a separate search server.
The usual suspects are Typesense, Elasticsearch, Meilisearch & Algolia.
In this episode we will create an index of our Posts on our own Typesense server.
Next, we will perform search and render results by sending requests to our Typesense API endpoint
TEXT walkthrough: https://blog.corsego.com/typesense-rails
Typesense source code: https://fnf.dev/3ZIAjId
Gem Typesense-ruby: https://fnf.dev/3PHqHcb
Gem Typesense-rails: https://fnf.dev/4jBiZhw
Integrating Typesense into SupeRails (members only): https://fnf.dev/40t6NX4
0:00 Different search engine APIs
02:02 About Typesense
3:30 Install Typesense
4:25 Typesense API - collections, documents, index all posts
8:25 Update Typesense index on Post Create/Update/Destroy
9:29 Typesense API to search collection
10:25 Rails Controller, views
12:00 Typesense-rails integration
13:00 Deploy to Production?
Thanks so much to Typesense for sponsoring this video!
I had a lot of fun integrating the search server with Rails.
2