Search Does Not Find Words Inside Guillemets quotes (« ») #5170

Closed
opened 2026-02-05 09:45:46 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @KocheshkovAA on GitHub (Feb 4, 2025).

Describe the Bug

The search does not find a word in Guillemets quotes (« ») when the quoted text contains only one word, and there is no space after the first opening quote.

Steps to Reproduce

  1. Create a page with text that includes a single word enclosed in Guillemets quotes, without a space after the first opening quote, for example: «Guillemets».
  2. Perform a search without using exact search: Guillemets.
  3. Observe that the search does not return the expected result when the word is enclosed in Guillemets quotes.

Image

Expected Behaviour

The search should return the expected result. In our example: Guillemets

Screenshots or Additional Context

Case 1: Search works correctly if there is a space after the opening quote
Text: « Guillemets», Search: Guillemets → Finds the word.

Image

Case 2: Search works correctly when there are multiple words inside the quotes
Text: «Guillemets test», Search: Guillemets test → Finds the word.

Image

Browser Details

No response

Exact BookStack Version

v24.12.1

Originally created by @KocheshkovAA on GitHub (Feb 4, 2025). ### Describe the Bug The search does not find a word in Guillemets quotes (« ») when the quoted text contains only one word, and there is no space after the first opening quote. ### Steps to Reproduce 1. Create a page with text that includes a single word enclosed in Guillemets quotes, without a space after the first opening quote, for example: «Guillemets». 2. Perform a search without using exact search: Guillemets. 3. Observe that the search does not return the expected result when the word is enclosed in Guillemets quotes. ![Image](https://github.com/user-attachments/assets/5125c76f-2a6c-4eb4-8f51-e15301b6c5a8) ### Expected Behaviour The search should return the expected result. In our example: Guillemets ### Screenshots or Additional Context **Case 1: Search works correctly if there is a space after the opening quote** Text: « Guillemets», Search: Guillemets → Finds the word. ![Image](https://github.com/user-attachments/assets/75d6e58a-df7a-462a-a296-f2684eaeb9fa) **Case 2: Search works correctly when there are multiple words inside the quotes** Text: «Guillemets test», Search: Guillemets test → Finds the word. ![Image](https://github.com/user-attachments/assets/6c2e80e8-3d4c-4df8-b172-ef289954e4fb) ### Browser Details _No response_ ### Exact BookStack Version v24.12.1
OVERLORD added the 🐛 Bug label 2026-02-05 09:45:46 +03:00
Author
Owner

@thegatesdev commented on GitHub (Feb 4, 2025):

Just wanted to add that in Case 2 the search still fails for the first word, the result only gets shown because it finds the word 'test'.
Looks like it doesn't split words on that character...

@thegatesdev commented on GitHub (Feb 4, 2025): Just wanted to add that in **Case 2** the search still fails for the first word, the result only gets shown because it finds the word 'test'. Looks like it doesn't split words on that character...
Author
Owner

@watschi commented on GitHub (Feb 4, 2025):

This should be related to #2095, my workaround described there should also work for « and »

Facing the same issue with hyphenated words, which are pretty common in german text.

Quick and dirty solution (needs to be applied after any update):

  • Edit app/Search/SearchIndex.php, add a hyphen (-) to $delimiters (at [Link](

33b46882f3/app/Search/SearchIndex.php (L19C1-L19C66) ))

  • Run php artisan bookstack:regenerate-search

  • For the word Test-Word, Test, Word and Test-Word will return the desired content

@ssddanbrown Any reason to exclude - from the delimiters? Feels like this should be included by default, maybe it's an oversight, maybe I'm missing something 🙂

Originally posted by @watschi in #2095

@watschi commented on GitHub (Feb 4, 2025): This should be related to #2095, my workaround described there should also work for `«` and `»` > Facing the same issue with hyphenated words, which are pretty common in german text. > > Quick and dirty solution (needs to be applied after any update): > > - Edit `app/Search/SearchIndex.php`, add a hyphen (`-`) to `$delimiters` (at [Link]( > > https://github.com/BookStackApp/BookStack/blob/33b46882f39106697a704dadd25f221f0dc2ff53/app/Search/SearchIndex.php#L19C1-L19C66 )) > > - Run `php artisan bookstack:regenerate-search` > > - For the word `Test-Word`, `Test`, `Word` and `Test-Word` will return the desired content > > > > @ssddanbrown Any reason to exclude `-` from the delimiters? Feels like this should be included by default, maybe it's an oversight, maybe I'm missing something 🙂 > > _Originally posted by @watschi in [#2095](https://github.com/BookStackApp/BookStack/issues/2095#issuecomment-2578019130)_
Author
Owner

@ssddanbrown commented on GitHub (Feb 14, 2025):

Thanks @KocheshkovAA for raising and thanks @thegatesdev @watschi for your input.
@inv-hareesh provided a PR via #5475 which has now been merged for next release.

@ssddanbrown commented on GitHub (Feb 14, 2025): Thanks @KocheshkovAA for raising and thanks @thegatesdev @watschi for your input. @inv-hareesh provided a PR via #5475 which has now been merged for next release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5170