I’m working on a project using Firebase (specifically using the new Firestore beta for my database) and want to use Algolia to enhance search. My database contains ingredients with associated substitutions. I want to be able to handle typos when users are searching for an ingredient (i.e. “olve oil” -> “olive oil”).
My current plan is:
-when the page loads build an array of all the ingredient names from my Firestore db (‘allIngredients’)
-use ‘allIngredients’ to create an index in Algolia
-when the user enters a search term, run it through Algolia to correct typos, etc.
-capture the corrected search term and use it to locate the appropriate record in my Firestore db
I understand that I am not supposed to expose my Admin API key to the front-end (i.e. don’t put it in my app.js file). However I need to write/update my Algolia index based on what’s in my Firestore db. Can someone advise me on how I should go about doing this?