Algolia is a search API that helps you add a search bar to websites and applications. In this tutorial you will build an Algolia search step-by-step starting with indexing and ending with search. In just 5 minutes, you'll have learned how search works and have a place to search your favorite actors.
Split your screen to have the code on one side and your browser on the other.
Set your settings to uncheck "Refresh on App Changes"
Application IDgoes with
Search-Only API Keygoes with
Admin API Keygoes with
.env fileso that this quickstart app knows how to connect to your Algolia application and index.
server.jsfile at the root of your project, a constant named
server/helpers/algolia.json line 65 and look at the
indexDatafunction where we pass the url that we just checked in Step 3. Here we are calling another function
dataToAlgoliaObjectthat will loop through each data point and create objects to send to Algolia.
objectID: data_point.objectIDon line 75 before uploading data.
server/helpers/algolia.jsline 108 and uncomment the settings under the
configureAlgoliaIndexfunction. Here you can read about which settings we are enabling for the index we just created and other options you have available!
setSettingson lines 110-126 before configuring index.
public/search.jsand comment in the
widgets.hitsHere we are telling the client side what kind of widgets we want to enable for our user to see the data we have just indexed and configured settings for.
widgetson lines 16-59 before viewing your data.