Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KocheshkovAA opened this issue Feb 4, 2025 · 2 comments
Open

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

KocheshkovAA opened this issue Feb 4, 2025 · 2 comments
Labels

Comments

@KocheshkovAA
Copy link

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

@thegatesdev
Copy link

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...

@watschi
Copy link

watschi commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants