Skip to content

Conversation

@samuelallan72
Copy link
Member

@samuelallan72 samuelallan72 commented Aug 28, 2025

Description

This includes two fixes (see individual commits) - please don't squash merge:

fix: override FORUM_SEARCH_BACKEND

The Tutor forum plugin hardcodes FORUM_SEARCH_BACKEND to Meilisearch,
so we need to override it here,
otherwise the forum will continue to use Meilisearch.

and

fix: increase Typesense max-per-page server option

The forum sets a constant search comment count of 1000
( https://github.com/openedx/forum/blob/51ec507/forum/constants.py ),
and the Elasticsearch and Meilisearch backends respect that.
So to use this value for Typesense too,
we need to increase the max-per-page server option.
The default is 250 in Typesense.

Supporting information

Test instructions

  • Set up a tutor devstack, with:
  • Create a test course in devstack
  • Navigate to the course's discussion tab
  • Create some posts and comments
  • Perform some searches
  • Verify search returns results and that there are no error messages relating to typesense in the logs.
  • View the data indexed in Typesense (perhaps by using https://bfritscher.github.io/typesense-dashboard ), and verify it's up to date with what's in the forum
  • View the Meilisearch dashboard ( http://meilisearch.local.openedx.io:7700 ), and verify there is no data indexed there relating to the forum.

Rough instructions for setting up the devstack:

cd devstack
git clone github.com/open-craft/forum
cd forum
git checkout samuel/typesense-backend
cd ..
tutor mounts add ./forum
tutor plugins enable forum

git clone github.com/open-craft/tutor-contrib-typesense
cd tutor-contrib-typesense
git checkout forum-fixes # oops sorry, I forgot to include my name in the branch name
cd ..
pip install -e ./tutor-contrib-typesense
tutor plugins enable typesense

tutor images build openedx-dev
tutor dev launch
tutor dev do importdemocourse

Deadline

None

The Tutor forum plugin hardcodes FORUM_SEARCH_BACKEND to Meilisearch,
so we need to override it here,
otherwise the forum will continue to use Meilisearch.

Private-ref: https://tasks.opencraft.com/browse/BB-9975
The forum sets a constant search comment count of 1000
( https://github.com/openedx/forum/blob/51ec507/forum/constants.py ),
and the Elasticsearch and Meilisearch backends respect that.
So to use this value for Typesense too,
we need to increase the max-per-page server option.
The default is 250 in Typesense.

Private-ref: https://tasks.opencraft.com/browse/BB-9975
Copy link
Member

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't manually test this yet but it seems straightforward enough.

@samuelallan72
Copy link
Member Author

Thanks @bradenmacdonald . :)

@samuelallan72 samuelallan72 merged commit a199bb7 into main Aug 28, 2025
2 checks passed
@samuelallan72 samuelallan72 deleted the forum-fixes branch August 28, 2025 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants