Algolia Integration
#
OverviewOur Algolia extension is used for search and comes out of the box with our example app, demo-v2
.
@deity/falcon-algoliasearch-api
@deity/falcon-algoliasearch-component
@deity/falcon-algoliasearch-endpoints
These integrate with:
@deity/falcon-search-extension
@deity/falcon-shop-extension
@deity/falcon-server
To see it in action please check out our demo store.
#
Supported Features- Product search
- Product search filtering
New features coming soon
We are actively developing our Algolia integration and will adding new features such as search term redirects, suggested search terms and more.
#
Getting StartedIf you're using our example app, demo-v2
most of the heavy lifting will be done for you and you'll only need to add a few configurations.
Prerequisites You'll need an API attached to your shop extension so Algolia has a source for product data. Currently this only works with our BigCommerce integration.
#
1. Create an Algolia accountBefore you start you'll need to create an Algolia account.

Once you've created an account you should be able to get your API keys.

#
2. Add your config to Falcon ServerThe next thing you'll need to do is add your API keys to your config files.
This is a full list of the config you'll need.
API Config This should be added to your env variables or your local.json. They can all be found within your Algolia admin.
You'll need the admin API key

#
3. Index your productsOnce you've created an account and configured it, the last thing to do is index your data.
#
Indexing / Managing indexesThis can be broken down into 3 sections. Configuring what data is searchable, running an initial index and updating indexes when products are updated.
#
1. Configuring your indexesThe first thing you'll need to do is configure what data is searchable. You can also configure facets (filters) here.
This is done in your server config:
server/config/default.json
#
Deity Cloud Environment VariablesALGOLIA_ENABLED
: [bool] - is Algolia enabledALGOLIA_APP_ID
: Your App IDALGOLIA_API_KEY
: Your API keyALGOLIA_INDEX_NAME
: The base index, if this index doesn't exist in Algolia yet it will be created for you.SEARCH_API_NAME
: You'll need to set Algolia as the search API. The value shoul bealgolia
#
2. Running an initial indexTo run your initial index you just need to use the autoReindex
flag in your config files.
Now you just need to start your app (Falcon Server) and all the products will be indexed.

n.b. If you want to run a fresh reindex of all your products we advise going into the Algolia admin and emptying your indexes there first.
This is a temporary config only needed for the initial index.
#
3. Updating indexes when product data changesTo keep indexes up to date with product data we use webhooks.
Falcon server has 2 events we subscribe to falcon-server.entity-updated
and falcon-server.entity-deleted
.
falcon-server.entity-updated
also runs when new entries (products) are added.
With our BigCommerce integration we use the WebHooks provided by BigCommerce to trigger these Falcon Server events which our @deity/falcon-algoliasearch-endpoints
listens for.