Discourse Algolia Search

:discourse2: Summary Discourse Algolia Search integrates Algolia with Discourse search.
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-algolia
:open_book: Install Guide How to install plugins in Discourse

Features

I’ve recently created a plugin that indexes topics, posts, users and tags with Algolia and combines them into a multi-category autocomplete search. Here’s a GIF of how it works:

You can find the Github repository, complete with installation instructions, on github at algolia/discourse-algolia.

Plugin configuration just requires populating a few fields. Indexing tasks are put in the jobs queue after objects are saved. Note: you will need to create an Algolia account, which is free up to 10,000 records.

Configuration

:raising_hand_woman: FAQ

Q: Does this replace the default Discourse search?
A: Only if you want it to, and right now only for the autocomplete in the header. The full search page is still reachable by hitting the enter key without a search result selected, or by using the “advanced search” link in the autocomplete footer. I say “only if you want it to” because you can enable indexing to Algolia but not affect the UI or existing Discourse search in any way - that’s why there are two checkboxes in the plugin settings. If you’re just doing indexing, you can search the data in your Algolia dashboard to see how it’s working.

Q: Do I have to pay to use the plugin?
A: It depends on how much data you have. If you have less than 1k posts, you should fit into Algolia’s free Community Plan, which gives you 10k records. A good rule of thumb is that you’ll need 10 Algolia records for each post, as posts are split up into-paragraph size chunks for optimum relevance and speed. Still, YMMV. If you’d like to use the plugin but have concerns about the cost, just send me an email and I’ll see what we can do. If you are an open source project or a non-profit, you may quality for higher limits, just fill out this form and mention Discourse.

CHANGELOG

2022.11.02

Pushed PR

  • Updated algoliasearch.js to 4.14.2
  • Updated autocomplete.js to 1.7.1

2020.09.08

Pushed 8 commits to GitHub - discourse/discourse-algolia: A plugin for indexing and searching your Discourse with Algolia

  • It should fix the bug where the search box stopped working after multiple page loads. :warning: NOTE: the plugin needs the very latest version of Discourse to work

  • The plugin is now using Discourse scss variables, and will now work correctly in Dark mode

  • Fixed a bug where user search was leading to /users instead of /u and would result in a 404. :warning: NOTE: You will need to reindex users for this to work correctly rake algolia:reindex_users

  • Fxed an alignment issue of the searchbox

  • Applied various coding standards

  • Removed part of the jquery usage

  • Searchbox should be slightly faster, as it’s now tied to rendering instead of arbitrary 100ms wait (also removed the forbidden setTimeout usage)


TODO

pr-welcome for the following tasks:

  • update algoliasearch (ruby)

This would ensure we are not deprecated in the future and allow to import libraries instead of having it in global namespace.

Last edited by @awesomerobot 2025-03-10T20:32:59Z

Check documentPerform check on document:
「いいね!」 61

プラグインは自動的に再インデックスしているようです。どのくらいの頻度で行われるか教えていただけますか?ドキュメントには記載されていません。
よろしくお願いします。

「いいね!」 1

コミュニティの誰かが答えを知らない限り、Discourseチームから回答を得るには来週までかかるかもしれません。

プラグインが、インデックス作成のためにキューに入れられたすべてのオブジェクト(投稿、トピック、ユーザー、タグ)を処理するために5分ごとにジョブを実行していることがわかります: https://github.com/discourse/discourse-algolia/blob/main/app/jobs/scheduled/update_indexes.rb。しかし、オブジェクトが再インデックスされる原因となる可能性のあるものについては、私には明確ではありません。

もし返答する機会があれば、コンテンツが再インデックスされているように見える理由について、あなたが見ていることを知りたいです。

「いいね!」 1

サイモンさん、返信ありがとうございます!テスト投稿を作成しました。Algoliaのアカウントを持っています。翌日ログインして、Algoliaの管理画面でその投稿を検索したところ、表示されました。投稿直後に確認した際にはAlgoliaに投稿が表示されなかったと思いますが、インデックス作成にはある程度の遅延があることは理解しています。5分であればかなり良いでしょう。別の投稿を試して、10分待って表示されるか確認してみます。ドキュメントにこのことについて言及がないことに驚いています。

「いいね!」 2

このプラグインをテストし始めたばかりです。いくつか質問があります。

  1. キーワードを検索すると、Algolia は Discourse がユニークなトピックを表示するのとは対照的に、同じトピックの異なる段落のみをリストします。そのトピックが最終的な答えでない限り、この方法はエンドユーザーにとってより制限的で不正確なようです。この動作は設定可能であるべきでしょうか?

  2. このプラグインは、poststagsusers の 3 つのタイプごとに Algolia アプリに 3 つのインデックスを作成します。このプラグインで、Algolia アプリで利用可能な他のインデックスを含めるにはどうすればよいですか?ユースケース:Algolia によるマルチサイト検索

最後の質問は機能リクエストに近いですが、最初の質問は、使用可能な検索結果のために設定可能なオプションである必要があると強く信じています。

「いいね!」 1

こんにちは。

自動補完検索はモバイルでも機能しますか? Algoliaフォーラムでは機能していないように見えます。

ねえ、

Algoliaコミュニティは利用できなくなり、Discordに移行しました。

Discourseフォーラムにさよなら(そして次に何が来るか)- Algolia Blog | Algolia

また、UXデザインが変更され、見た目がよりモダンになりました。プラグインを更新する予定はありますか?

また、「ログイン」と「登録」ボタンを右隅(デフォルト)に移動し、検索バーを中央に配置することは、「Header Search」テーマコンポーネントのように可能ですか?
direita

「いいね!」 2

現時点では具体的な予定はありません。このプラグインを使用しているお客様はごく少数です。

「いいね!」 3