{"id":18711904,"url":"https://github.com/GitbookIO/plugin-algolia","last_synced_at":"2025-04-12T12:31:06.025Z","repository":{"id":73453558,"uuid":"56148810","full_name":"GitbookIO/plugin-algolia","owner":"GitbookIO","description":"Power search using Algolia","archived":false,"fork":false,"pushed_at":"2017-11-07T23:08:09.000Z","size":103,"stargazers_count":25,"open_issues_count":5,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T05:04:24.580Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GitbookIO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-13T12:12:39.000Z","updated_at":"2023-04-21T11:06:40.000Z","dependencies_parsed_at":"2023-02-28T13:01:40.758Z","dependency_job_id":null,"html_url":"https://github.com/GitbookIO/plugin-algolia","commit_stats":{"total_commits":60,"total_committers":5,"mean_commits":12.0,"dds":0.4666666666666667,"last_synced_commit":"e84a54107045c438fc08279409fc1f80367293e2"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fplugin-algolia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fplugin-algolia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fplugin-algolia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fplugin-algolia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GitbookIO","download_url":"https://codeload.github.com/GitbookIO/plugin-algolia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248566468,"owners_count":21125673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T12:40:43.445Z","updated_at":"2025-04-12T12:31:05.694Z","avatar_url":"https://github.com/GitbookIO.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Power search using Algolia\n\nUse Algolia as a back-end to index and search your book's content.\n\nThis plugins requires gitbook `\u003e=4.0.0`.\n\n## How to use it?\n\n### Create an Algolia account\n\n1. Sign up to [Algolia](https://www.algolia.com)\n2. Set up a basic index.\n3. Access your [API keys settings](https://www.algolia.com/api-keys), and keep this page open for the next steps.\n\n### Set up the plugin in your book.\n\n1. Open Settings \u003e Plugins Store interface in the GitBook Editor.\n2. Install the `algolia` plugin.\n3. Specify the following values in the modal for your book:\n    * **Algolia Index Name**, which is the name of the index you set up in Algolia web.\n    * **Algolia Application ID**, which is your unique application ID for API identification.\n    * **Algolia Search-Only API Key**, which is the unique ID for search queries.\n    * **Is your Algolia account free**, which you leave as `true` if you have what Algolia call a \"Hacker Account\".\n\nOr if you prefer, you can declare the plug-in values in the `book.json` file. Add the plugin and its configuration to your `book.json`:\n\n```JSON\n{\n    \"plugins\": [\"algolia\"],\n    \"pluginsConfig\": {\n        \"algolia\": {\n            \"index\": \"algolia-index-name\",\n            \"applicationID\": \"algolia-application-id\",\n            \"publicKey\": \"algolia-search-only-api-key\",\n            \"freeAccount\": \"true\"\n        }\n    }\n}\n```\n\n### Set Algolia Environment Variables\n\nIf you are using the GitBook Editor, you can specify the `ALGOLIA_PRIVATEKEY` in the Settings of your book.\n\n1. Login to https://www.gitbook.com\n2. Go to the `Settings` of the book you want to add the environment variable to.\n4. Scroll down to the `Environment Variables` group.\n5. Add a new variable, named `ALGOLIA_PRIVATEKEY`, and put your **Admin API Key** as value.\n\nIf you are using the command line, pass your **Admin API Key** as an environment variable when launching gitbook:\n\n```Bash\n$ ALGOLIA_PRIVATEKEY=\"algolia-admin-api-key\" gitbook serve\n```\n\n#### A note about the index\n\n**WARNING** The plugin will replace the entire index at each build phase. Do not use an existing index, unless you no longer require its contents.\n\nWhen setting up the basic index on Algolia, you will be prompted to generate or import the index so Algolia can begin analysing your book.\n\nYou do not need to create the index manually for the plugin to work.\n\n\n### Adding keywords to a page\n\nYou can specify explicit keywords for any page.\n\n```md\n---\nsearch:\n    keywords: ['keyword1', 'keyword2', 'etc.']\n\n---\n\n# My Page\n\nThis page will rank better if we search for 'keyword1'.\n```\n\n### Disabling indexing of a page\n\nYou can disable the indexing of a specific page by adding a YAML header to the page:\n\n```md\n---\nsearch: false\n---\n\n# My Page\n\nThis page is not indexed in by Algolia.\n```\n\n### Fine tuning the Algolia search rankings\n\nAfter having indexed your book at least once, you can configure your Algolia index from your [dashboard](https://www.algolia.com/explorer). You can go to the _Ranking_ settings and tell Algolia how to search your pages. You can see below an example configuration, that tells Algolia to search, by order of importance, the keywords of your pages, their title, and finally their content (body).\n\n![Example ranking configuration](./algolia-ranking.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGitbookIO%2Fplugin-algolia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGitbookIO%2Fplugin-algolia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGitbookIO%2Fplugin-algolia/lists"}