Search Result Event

Hi All,

On our Shopify collection pages, we have added questions to the top of the page to help the user to select the correct filter.

Here the user is asked to select the type of Shock Mount that their bike has. The user will select one of the options and the Shock Mounting Type filter will be set in the Algolia Widget.

We have developed a new Shopify Snippet called “Guided Nav.liquid” that displays the questions. The snippet is rendered in the Shopify Section “main-collection-banner.liquid”.

Inside the new snippet we have the following Javascript that takes the users selected option pill.dataset.facetoption, clears any refinements on the facet, adds the new facet refinement, and then calls the Algolia search.
            .addFacetRefinement(pill.dataset.facet, pill.dataset.facetoption)

Is there a way in the snippet javascript to have the search event trigger a function to see the results that have been returned by the search?

The AlgoliaSearchHelper article references a number of events that are fired in the search cycle.

I’m just not sure how to add this into my local snippet javascript.