Search does not work if   presents before text #5301

Closed
opened 2026-02-05 09:56:19 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @rockenren on GitHub (Jun 3, 2025).

Describe the Bug

If text line contains   at the beginning (before text), search will not show it in results until   is removed.
If   presents after the text, search will work.

Search index regeneration does not resolve this issue.

I can't say for sure when it broke.

Steps to Reproduce

  1. Create new page or edit existing page
  2. Add   via Edit Source before any text
  3. Try searching this text, search results will not display this page
  4. Remove   via Edit Source before text used above
  5. Search will work as expected, showing page in results

Expected Behaviour

Search should work while ignoring  

We have more than 200+ pages with   in HTML and I can't say for sure how many of it contains   before the text, 'breaking' our search index.

Screenshots or Additional Context

No response

Browser Details

Firefox 139.0.1, Chromium 134.0.6998.102

Exact BookStack Version

v25.05

Originally created by @rockenren on GitHub (Jun 3, 2025). ### Describe the Bug If text line contains ` ` at the beginning (before text), search will not show it in results until ` ` is removed. If ` ` presents after the text, search will work. Search index regeneration does not resolve this issue. I can't say for sure when it broke. ### Steps to Reproduce 1. Create new page or edit existing page 2. Add ` ` via Edit Source before any text 3. Try searching this text, search results will not display this page 4. Remove ` ` via Edit Source before text used above 5. Search will work as expected, showing page in results ### Expected Behaviour Search should work while ignoring ` ` We have more than 200+ pages with ` ` in HTML and I can't say for sure how many of it contains ` ` before the text, 'breaking' our search index. ### Screenshots or Additional Context _No response_ ### Browser Details Firefox 139.0.1, Chromium 134.0.6998.102 ### Exact BookStack Version v25.05
OVERLORD added the 🐛 Bug label 2026-02-05 09:56:19 +03:00
Author
Owner

@virtadpt commented on GitHub (Jun 4, 2025):

I've been seeing this problem for about six months now. It took me a while to get into the habit of hitting 'home' to make sure there were no spaces before my search terms.

@virtadpt commented on GitHub (Jun 4, 2025): I've been seeing this problem for about six months now. It took me a while to get into the habit of hitting 'home' to make sure there were no spaces before my search terms.
Author
Owner

@ssddanbrown commented on GitHub (Jun 17, 2025):

Thanks @rockenren for raising and thanks @virtadpt for confirming.
This has now been addressed via f518a3be37, and will be part of the next patch release.

You'll probably want to regenerate the search index after updating to address existing search indexing, otherwise you won't be able to search on those terms still unless something triggers a re-index (updating the page, or running the referenced regen command).

@ssddanbrown commented on GitHub (Jun 17, 2025): Thanks @rockenren for raising and thanks @virtadpt for confirming. This has now been addressed via f518a3be373500b0382b49ef814b9c5ee76c3d8e, and will be part of the next patch release. You'll probably want to [regenerate the search index](https://www.bookstackapp.com/docs/admin/commands/#regenerate-the-search-index) after updating to address existing search indexing, otherwise you won't be able to search on those terms still unless something triggers a re-index (updating the page, or running the referenced regen command).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5301