This quickstart demonstrates various usages of the Algolia JavaScript API Client.
- An Algolia account. If you don't have one already, create an account for free.
- A Node local environment, or Docker.
Using VSCode
By using VScode and having the Visual Studio Code Remote - Containers extension installed, you can run any of the quickstarts by using the command Remote-Containers: Open Folder in Container command.
Each of the quickstart contains a .devcontainer.json, along with a Dockerfile.
- Create an Algolia Application and an Algolia Index
- Copy the file .env.example and rename it to
.env
- Set the environment variables
ALGOLIA_APP_ID
,ALGOLIA_API_KEY
andALGOLIA_INDEX_NAME
in the.env
file. You can obtain those from the Algolia Dashboard. TheALGOLIA_API_KEY
should be the "Admin API Key" (necessary for indexing).
Once setup, you can run each of the script in this folder using the Node command line.
Example: to execute the simple.js
script:
node simple.js
| File | Description |
| ---------------------------- | -------------------------------------------- |
| simple.js | Index a single object and run a search query |
| indexing.js | Showcase of the main indexing methods |
| generate_key.js | Generate a rate-limited search only API key |
| export_and_add_rule_to_index.js | Export and add Rules to index |
| change_index_settings.js | Change index settings |
| rest_API_return_top_1000_hits.js | Return Top 1000 Searches |
| backup_index.js | Generates a backup of records, settings, synonyms and rules in separate JSON files |
| restore_index.js | Allows user to restore a backup of records, settings, synonyms and rules to an index |