{"id":18707582,"url":"https://github.com/discourse/discourse-algolia","last_synced_at":"2025-08-20T10:32:27.821Z","repository":{"id":39884389,"uuid":"104114502","full_name":"discourse/discourse-algolia","owner":"discourse","description":"A plugin for indexing and searching your Discourse with Algolia","archived":false,"fork":false,"pushed_at":"2024-11-28T14:49:22.000Z","size":732,"stargazers_count":41,"open_issues_count":15,"forks_count":18,"subscribers_count":29,"default_branch":"main","last_synced_at":"2024-12-09T14:50:07.620Z","etag":null,"topics":["algolia","discourse-plugin"],"latest_commit_sha":null,"homepage":"https://meta.discourse.org/t/add-algolia-search-to-your-discourse/73517","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/discourse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2017-09-19T18:46:39.000Z","updated_at":"2024-11-28T14:49:25.000Z","dependencies_parsed_at":"2024-01-14T23:39:54.073Z","dependency_job_id":"4acc1afb-e35b-486a-9e44-851c9b90e79a","html_url":"https://github.com/discourse/discourse-algolia","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-algolia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-algolia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-algolia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fdiscourse-algolia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discourse","download_url":"https://codeload.github.com/discourse/discourse-algolia/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230415318,"owners_count":18222158,"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":["algolia","discourse-plugin"],"created_at":"2024-11-07T12:18:58.617Z","updated_at":"2025-08-20T10:32:27.816Z","avatar_url":"https://github.com/discourse.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# discourse-algolia [beta]\n\nOfficial Plugin Topic \u0026 Documentation: https://meta.discourse.org/t/add-algolia-search-to-your-discourse/73517\n\nPower the search on your Discourse with [Algolia](https://algolia.com/) 🔎🎉\n\nThe discourse-algolia plugin indexes users, posts, topics and tags with Algolia and adds a search box built with [autocomplete.js](https://github.com/algolia/autocomplete.js) to the Discourse header. \n\n## Features\n\nThe discourse-algolia plugin uses the Algolia API, which provides powerful indexing and search capabilities.\n\n- Speed: Results update immediately with each keystroke\n- Relevance: Metrics like views and likes are used to surface the best content first\n- User experience: All indicies are searched simultaneously and presented in a unified view\n- Analytics: See what users are searching for, see top queries that produce 0 results\n\n## Prerequisites\n\nYou'll need an Algolia account if you don't have one already.\n\n- Go here to [sign up](https://algolia.com/users/sign_up) for a free account (10,000 records and 100,000 indexing operations monthly)\n- If you're using Discourse for an open source project and need higher limits, fill out the form on the [Algolia for Open Source](https://algolia.com/for-open-source) page.\n- If you need higher limits for your business, we're happy to help you [find the right plan](mailto:hey@algolia.com).\n\n## Beta testers wanted\n\nPlease see this thread on meta.discourse.org for more information: [Add Algolia search to your Discourse](https://meta.discourse.org/t/add-algolia-search-to-your-discourse/73517).\n\n## Installation\n\nAdd this repository's `git clone` url to your container's `app.yml` file, at the bottom of the `cmd` section:\n\n```yml\nhooks:\n  after_code:\n    - exec:\n        cd: $home/plugins\n        cmd:\n          - mkdir -p plugins\n          - git clone https://github.com/discourse/discourse-algolia.git\n```\n\nRebuild your container:\n\n```\ncd /var/discourse\ngit pull\n./launcher rebuild app\n```\n\n## Configuration\n\nOnce you've installed the plugin and restarted your Discourse, you will see a new plugin available in your admin configuration. Click the `Settings` button next to the `discourse-algolia` plugin.\n\n![plugins_list](https://user-images.githubusercontent.com/5862206/214546935-31fdcbcc-e87e-4df2-b70f-ba58c98c41c3.png)\n\nYou will now see all of the plugin configuration options available.\n\n![config](https://user-images.githubusercontent.com/5862206/214546977-9ef651b0-e866-475a-81f0-1eb115c785fc.png)\n\nPopulate the settings as follows:\n\n- **algolia enabled**: Check this box to enable indexing new content with Algolia.\n- **algolia autocomplete enabled**: Check this box to replace the default Discourse autocomplete with the Algolia autocomplete. It is recommended to do this only once you have all content indexed (see below).\n- **algolia application id**: The ID of an Algolia application you have created.\n- **algolia search api key**: A search-only API key of the Algolia application. Do not use an admin API key, as this will be visible to the clients of your Discourse.\n- **algolia admin api key**: The admin API key of your Discourse application, or any API key that can write and configure indices.\n\nYou can find the **algolia application id**, **algolia search api key**, and **algolia admin api key** in the **API Keys** page of your [Algolia dashboard](https://algolia.com/dashboard/).\n\n![algolia_dash](https://user-images.githubusercontent.com/5862206/214547025-54fe7b5a-f7ec-4690-836b-5a58c42d4df8.png)\n\nOnce all of the settings are turned on and populated, the plugin configuration should look like this:\n\n![config_example](https://user-images.githubusercontent.com/5862206/214547108-6832c971-7e0b-4cf1-84cc-bc0e70b544de.png)\n\n## Initial indexing\n\nOnce you have enabled the Algolia plugin and added an application ID and admin API key, you can now index all of your forum's content. Run the following rake task in your Discourse directory:\n\n```shell\nLOAD_PLUGINS=1 bundle exec rails algolia:reindex\n```\n\nThis will create and configure three indices - `discourse-users`, `discourse-posts`, and `discourse-tags` - and then populate them by loading data from your database and sending it to Algolia. The data will be searchable as soon as the task is finished. You can now enable the **algolia autocomplete enabled** setting of the plugin, reload the page of your Discourse, and try the autocomplete search.\n\n## Rake tasks\n\nTo run rake tasks, first `cd` into your Discourse directory. If you're using the Docker install, just run this command:\n\n```shell\n./launcher enter app\n```\n\nAdditional rake tasks are provided for configuring indices and syncing data.\n\n```\nrake algolia:reindex                                                   # reindex everything to algolia\nrake algolia:reindex_posts                                             # reindex posts in algolia\nrake algolia:reindex_tags                                              # reindex tags in algolia\nrake algolia:reindex_users                                             # reindex users in algolia\n```\n\n## Styling with CSS\n\nTo see how you can change the look and feel of the autocomplete, see the CSS styles in the plugin's [assets/stylesheets](https://github.com/algolia/discourse-algolia/tree/main/assets/stylesheets) directory.\n\n```\n .algolia-holder .aa-input {\n    color: #919191;\n    font-family: Open Sans, Arial, sans-serif;\n    border: solid 1px rgba(137,149,199,0.2);\n    border-radius: 6px;\n    font-size: 13px;\n    line-height: 13px;\n    padding: 8px 10px 8px 35px;\n    height: auto;\n    width: 250px;\n    outline: 0;\n    background-image: url(\"data:image/svg+xml;utf8,\u003csvg width='14' height='14' viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'\u003e\u003cpath d='M12.5 11h-.79l-.28-.27C12.41 9.59 13 8.11 13 6.5 13 2.91 10.09 0 6.5 0S0 2.91 0 6.5 2.91 13 6.5 13c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L17.49 16l-4.99-5zm-6 0C4.01 11 2 8.99 2 6.5S4.01 2 6.5 2 11 4.01 11 6.5 8.99 11 6.5 11z' fill='%237C8A94' fill-rule='evenodd'/\u003e\u003c/svg\u003e\");\n    background-size: 14px 14px;\n    background-repeat: no-repeat;\n    background-position: 10px center;\n  }\n```\n\nYou'll see style definitions like this, which you can override by creating a fork of the plugin or more easily by using the CSS/HTML customization that Discourse makes available in the Admin tool.\n\n## Customizing ranking\n\nOnce you've indexed your data with Algolia, you can see it and search it from the Algolia dashboard. That will give you an idea of what attributes the plugin indexes. You can also make changes to relevance and other index configuration settings. A full treatment of ranking, relevance and the Algolia dashboard is out of scope here, but we encourage you to head over to the [Algolia documentation](https://algolia.com/doc/) and start digging in.\n\n![algolia_dashboard_indices](https://user-images.githubusercontent.com/5862206/214547733-dad6f4ba-0284-4662-8e53-a7754ba78d4f.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscourse%2Fdiscourse-algolia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscourse%2Fdiscourse-algolia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscourse%2Fdiscourse-algolia/lists"}