BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

Search does not work if   presents before text

Open rockenren opened this issue 7 months ago • 1 comments

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

rockenren avatar Jun 03 '25 05:06 rockenren

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 avatar Jun 04 '25 01:06 virtadpt

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 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 avatar Jun 17 '25 13:06 ssddanbrown