[PR #5488] [MERGED] Search index improvements #6503

Closed
opened 2026-02-05 10:34:03 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/5488
Author: @ssddanbrown
Created: 2/14/2025
Status: Merged
Merged: 2/14/2025
Merged by: @ssddanbrown

Base: developmentHead: search_index_updates


📝 Commits (5)

  • d938565 Fix search issue for words inside Guillemets (« ») without spaces
  • 45a15b4 Searching: Split out search tests into their own dir
  • f444992 Searching: Added custom tokenizer that considers soft delimiters.
  • c291d27 Merge branch 'inv-hareesh/development' into search_index_updates
  • f1b8e85 Searching: Added test for guillemets

📊 Changes

7 files changed (+333 additions, -189 deletions)

View changed files

📝 app/Search/SearchIndex.php (+34 -7)
📝 app/Search/SearchOptions.php (+1 -1)
app/Search/SearchTextTokenizer.php (+70 -0)
📝 tests/Search/EntitySearchTest.php (+1 -180)
tests/Search/SearchIndexingTest.php (+109 -0)
📝 tests/Search/SearchOptionsTest.php (+1 -1)
tests/Search/SiblingSearchTest.php (+117 -0)

📄 Description

  • Adds more advanced indexing to retain terms joined with certain punctuation (.-).
  • Adds «giullemets» as term delimiters.
  • Breaks out search tests into multiple classes within their own dir.

From testing, custom indexing tokenization slows indexing speed by about 5-10% on my dev instance (37k pages).
Seems within reason, will be minor actual speed impact in normal use.

Re-indexing may be needed to receive benefits.

php artisan bookstack:regenerate-search

Docs update

  • Just a note on the feature mention in blogpost to re-index, does not really need to be an update advisory.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/5488 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 2/14/2025 **Status:** ✅ Merged **Merged:** 2/14/2025 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `search_index_updates` --- ### 📝 Commits (5) - [`d938565`](https://github.com/BookStackApp/BookStack/commit/d938565839e5c59576b45ccb6e8caa40baa7129d) Fix search issue for words inside Guillemets (« ») without spaces - [`45a15b4`](https://github.com/BookStackApp/BookStack/commit/45a15b479294349638bbe334f8701f077aa899c4) Searching: Split out search tests into their own dir - [`f444992`](https://github.com/BookStackApp/BookStack/commit/f4449928f83748d015a633cdc1cef50fe822648c) Searching: Added custom tokenizer that considers soft delimiters. - [`c291d27`](https://github.com/BookStackApp/BookStack/commit/c291d27c19b69641c067da3aefc0623016f34471) Merge branch 'inv-hareesh/development' into search_index_updates - [`f1b8e85`](https://github.com/BookStackApp/BookStack/commit/f1b8e857bf68eb83ecc2db40da53f5d4626a16de) Searching: Added test for guillemets ### 📊 Changes **7 files changed** (+333 additions, -189 deletions) <details> <summary>View changed files</summary> 📝 `app/Search/SearchIndex.php` (+34 -7) 📝 `app/Search/SearchOptions.php` (+1 -1) ➕ `app/Search/SearchTextTokenizer.php` (+70 -0) 📝 `tests/Search/EntitySearchTest.php` (+1 -180) ➕ `tests/Search/SearchIndexingTest.php` (+109 -0) 📝 `tests/Search/SearchOptionsTest.php` (+1 -1) ➕ `tests/Search/SiblingSearchTest.php` (+117 -0) </details> ### 📄 Description - Adds more advanced indexing to retain terms joined with certain punctuation (`.-`). - Adds `«giullemets»` as term delimiters. - Breaks out search tests into multiple classes within their own dir. From testing, custom indexing tokenization slows indexing speed by about 5-10% on my dev instance (37k pages). Seems within reason, will be minor actual speed impact in normal use. Re-indexing may be needed to receive benefits. ```bash php artisan bookstack:regenerate-search ``` ### Docs update - Just a note on the feature mention in blogpost to re-index, does not really need to be an update advisory. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:34:03 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6503