Skip to content

Commit bc5ed96

Browse files
committed
feat: add Typesense backend for search
Support searching forum threads and comments using Typesense as a backend. This is completely backwards compatible; Meilisearch can still be used as the backend with no changes, and existing installations will continue to be configured to use Meilisearch. The new backend can be enabled by setting: ```py TYPESENSE_ENABLED = True ``` You can also manually set the backend for testing with something like: ```py FORUM_SEARCH_BACKEND = "forum.search.typesense.TypesenseBackend" ``` Configuring the Typesense backend can be done with these settings: ```py TYPESENSE_API_KEY = "your-secret-api-key" TYPESENSE_URLS = ["https://typesense-1.example.com:8108", "https://typesense-2.example.com:8108"] ``` The actual implementation differs from the Meilisearch backend in some areas, mostly for internal efficiency. For example, a single index is used to cover both threads and comments, while Meilisearch uses two. It aims to produce comparable results for searches by end users though. Private-ref: https://tasks.opencraft.com/browse/BB-9975
1 parent a5f31e6 commit bc5ed96

12 files changed

Lines changed: 499 additions & 2 deletions

File tree

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Change Log
1414
Unreleased
1515
**********
1616

17-
*
17+
* Add support for Typesense as the search backend.
1818

1919
0.3.4 – 2025-08-13
2020
******************
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Configuring Typesense Search Backend
2+
====================================
3+
4+
Forum also supports Typesense as the search backend.
5+
Typesense as both a single node and as a HA cluster is supported.
6+
7+
This is not the default though; Meilisearch is the default backend.
8+
9+
To configure, you can set the following Django settings for LMS and CMS:
10+
11+
.. code-block:: python
12+
13+
TYPESENSE_ENABLED = True
14+
TYPESENSE_API_KEY = "your-secret-api-key-for-typesense"
15+
TYPESENSE_URLS = ["https://typesense-1.example.com:8108", "https://typesense-2.example.com:8108"]
16+
# Optional: if you need to manually override the backend path for testing
17+
#FORUM_SEARCH_BACKEND = "forum.search.typesense.TypesenseBackend"
18+
19+
Alternately, if you deploy using Tutor, you can use the `tutor-contrib-typesense`_
20+
plugin, which will automatically deploy a single node Typesense instance
21+
and configure forum to use it.
22+
23+
.. _tutor-contrib-typesense: https://github.com/open-craft/tutor-contrib-typesense/

docs/how-tos/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
How-tos
22
#######
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
:glob:
7+
8+
./*

0 commit comments

Comments
 (0)