Discourse Algolia Suche

: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 „Gefällt mir“

Das Plugin scheint automatisch neu zu indizieren. Kann mir jemand sagen, wie oft es das tut? Ich sehe keine Dokumentation dazu.
Danke

1 „Gefällt mir“

Es sei denn, jemand in der Community kennt die Antwort, es könnte bis nächste Woche dauern, bis wir eine Antwort vom Discourse-Team erhalten.

Ich sehe, dass das Plugin alle 5 Minuten einen Job ausführt, um alle Objekte (Beiträge, Themen, Benutzer, Tags) zu verarbeiten, die für die Indizierung in der Warteschlange stehen: discourse-algolia/app/jobs/scheduled/update_indexes.rb at main · discourse/discourse-algolia · GitHub. Mir ist nicht klar, was dazu führen würde, dass ein Objekt neu indiziert wird.

Wenn Sie die Gelegenheit haben zu antworten, würde mich interessieren, was Sie sehen, das den Eindruck erweckt, dass Inhalte neu indiziert werden.

1 „Gefällt mir“

Hallo Simon, danke für die Antwort! Ich habe einen Testbeitrag erstellt. Wir haben ein Algolia-Konto. Am nächsten Tag habe ich mich eingeloggt und diesen Beitrag in der Algolia-Verwaltung gesucht und er wurde angezeigt. Ich glaube, ich hatte direkt nach dem Posten nachgesehen und den Beitrag nicht in Algolia gesehen. Aber ich verstehe, dass es eine gewisse Verzögerung bei der Indizierung geben muss. 5 Minuten wären ziemlich gut. Ich kann einen weiteren Beitrag ausprobieren und 10 Minuten warten, um zu sehen, ob er da ist. Ich bin überrascht, dass dies in der Dokumentation nicht erwähnt wird.

2 „Gefällt mir“

Ich habe gerade mit dem Testen dieses Plugins begonnen. Ein paar Fragen:

  1. Wenn ich nach einem Schlüsselwort suche, listet Algolia nur verschiedene Absätze zum gleichen Thema auf, anstatt wie bei Discourse eindeutige Themen anzuzeigen. Es sei denn, dieses Thema ist die endgültige Antwort, scheint diese Methode für die Endbenutzer restriktiver und ungenauer zu sein. Sollte dieses Verhalten konfigurierbar sein?

  2. Das Plugin erstellt 3 Indizes in der Algolia-App, jeweils für die Typen posts, tags und users. Wie kann ich dieses Plugin dazu bringen, andere verfügbare Indizes in meiner Algolia-App einzuschließen? Anwendungsfall: Multisite-Suche über Algolia

Letzteres ist eher eine Funktionsanfrage, aber ich glaube fest daran, dass das erste eine konfigurierbare Option für brauchbare Suchergebnisse sein muss.

1 „Gefällt mir“

Hallo,

funktioniert die Autovervollständigungs-Suche auch für Mobilgeräte? Ich kann nicht sehen, dass sie im Algolia-Forum funktioniert.

Hallo,

die Algolia-Community ist nicht mehr verfügbar, sie sind zu Discord migriert

Wir verabschieden uns von unseren Discourse-Foren (und was als Nächstes kommt) - Algolia Blog | Algolia

Außerdem hat sich das UX-Design geändert. Sieht jetzt moderner aus. Gibt es Pläne, das Plugin zu aktualisieren?

und ist es möglich, die Schaltflächen „Anmelden“ und „Registrieren“ in die rechte Ecke (standardmäßig) zu verschieben und die Suchleiste zu zentrieren, genau wie bei der Theme-Komponente „Header Search“?

rechts

2 „Gefällt mir“

Im Moment gibt es nichts Konkretes, wir haben nur sehr wenige Kunden, die dieses Plugin nutzen.

3 „Gefällt mir“