DEV Community

loading...
Cover image for DO Hackathon: Search

DO Hackathon: Search

gillarohith profile image Rohith Gilla ・2 min read

I don't know what do we call such a situation 👇

"When you feel everything is ready and you are preparing for the final submission, there is a crazy requirement that pops up"

It happened to me ❄️

When everything is going like breeze I got stuck in an avalanche.

Avalnche

Let me give you a TL;DR of the story, so I gave the business with the initial version of the MVP, they really enjoyed it and used it for a while and they came up with a requirement asking

"This is quite amazing, but what if we want to search in all the 8k products available at once?"

This is it, I was going crazy because the database I used is a firebase firestore, and it doesn't support full-text search.

Fetching 8k products from the database and searching from them locally would only profit Google, also since few clients stay in remote areas the internet speed is pretty low.

Then I watched Kung fu panda, gained the required motivation and then started on it again.

Inner peace

I came across Algolia and Elastic Search during my research. Both of them felt so promising, but the catch here is I never used any of them sadly. After a bit of research and digging my email, I realised I had some credits in Algolia so inevitably I choose it.

I am thanos

Here is an interesting part, to make Algolia search to work, we need to store all the data in Algolia. For that, I have written a small node js application to handle that.

Algolia part

Finally, after creating the search index, it was just connecting the endpoint with the frontend.

Thanks to redux thunks, it handles asynchronous actions pretty dope.

All products search

App SS

Finally, will add a few minor things and then will make a final submission in the next post.

Thanks

Peace ✌🏻
Rohith Gilla

Discussion (0)

pic
Editor guide