Algolia Search

basic configuration
React InstantSearch Documentation

Refinement List

The RefinementList component gives a list of attributes to filter by.

Refinement Configuration

For filters / faceting attributes, settings need to be configured in the Algolia Dashboard before they can be utilized in the frontend.

Add Attributes for Faceting

Select Facets for Display

Import the RefinementList component & give the attribute you configured for the attribute prop.

Customize Refinement Lists

This example uses the transformItems option to filter out the defaultRefinement for Used Equipment

Sort By

The SortBy component must be configured in the Algolia backend by duplicating indices and adjusting the relevance priority.

Create a Replica Index & Adjust the Configuration
Adjust the Ranking Priority

Now we can import the SortBy component. Give the required defaultRefinement prop your default index. Then, assign the replicated indices with their corresponding labels.

Custom Widgets

These are needed to provide custom props to InstantSearch Widgets

Hits

Custom Hits Component

RefinementList

Can filter by facets that are configured in the Algolia dashboard

ClearRefinements

Removes filters

PHP Client

Algolia docs for PHP client

Replace All Objects

how re-index works

Last updated

Was this helpful?