Configure Search

Configuring Search

If appropriately configured, Grai has a powerful search function.

Algolia

Grai search is powered by Algolia. To get started you will need to create an account on Algolia at https://www.algolia.com/users/sign_up (opens in a new tab).

You will need to set the following environment variables:

VariableValue
ALGOLIA_APPLICATION_IDThis is your unique application identifier. It's used to identify you when using Algolia's API.
ALGOLIA_ADMIN_KEYThis is the ADMIN API key. Please keep it secret and use it ONLY from your backend: this key is used to create, update and DELETE your indices. You can also use it to manage your API keys.
ALGOLIA_SEARCH_KEYThis is the public API key to use in your frontend code. This key is only usable for search queries and sending data to the Insights API.

Indexing

To index your existing content, you will need to run the following command:

python manage.py algolia_reindex

More details

For more information about the Grai Algolia integration see https://www.algolia.com/doc/framework-integration/django/setup (opens in a new tab).