[PR #5854] [MERGED] Pagable and efficient search #6585

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

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/5854
Author: @ssddanbrown
Created: 10/27/2025
Status: Merged
Merged: 10/29/2025
Merged by: @ssddanbrown

Base: developmentHead: efficient_search


📝 Commits (4)

  • 0b26573 Search: Started work to make search result size consistent
  • f0303de Search: Improved result hydration performance
  • 3fd25bd Search: Added pagination, updated other search uses
  • 751934c Search: Tested changes to single-table search

📊 Changes

11 files changed (+338 additions, -115 deletions)

View changed files

📝 app/Entities/Models/Entity.php (+13 -0)
app/Entities/Models/EntityTable.php (+69 -0)
📝 app/Entities/Queries/EntityQueries.php (+31 -2)
app/Entities/Tools/EntityHydrator.php (+140 -0)
📝 app/Entities/Tools/MixedEntityListLoader.php (+1 -1)
📝 app/Search/SearchApiController.php (+5 -4)
📝 app/Search/SearchController.php (+8 -6)
📝 app/Search/SearchRunner.php (+63 -97)
📝 resources/views/search/all.blade.php (+1 -5)
📝 tests/Api/SearchApiTest.php (+1 -0)
📝 tests/Search/EntitySearchTest.php (+6 -0)

📄 Description

This PR aims to change how searches are done, to use a single core query instead of a query per entity type.
This should make the search more efficient, while resulting in a stable & consistent response item count.

Todo

  • Debug large response processing time gap between making the queries, and rendering the views.
  • Update API search endpoint description.
  • Address remaining TODOs
  • Test other search controller methods (anything which uses SearchRunner).
  • Test edge-case scenarios (different search types, filtered entity types, no tags in results, no parent items etc...)
  • Testing

🔄 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/5854 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 10/27/2025 **Status:** ✅ Merged **Merged:** 10/29/2025 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `efficient_search` --- ### 📝 Commits (4) - [`0b26573`](https://github.com/BookStackApp/BookStack/commit/0b265733142a21de91ed90d0e197c48b0561bb1e) Search: Started work to make search result size consistent - [`f0303de`](https://github.com/BookStackApp/BookStack/commit/f0303de2e5aa5a2e7b2bc805653c5cf3039ea290) Search: Improved result hydration performance - [`3fd25bd`](https://github.com/BookStackApp/BookStack/commit/3fd25bd03e15a965213d61b5887b15ba3d172eef) Search: Added pagination, updated other search uses - [`751934c`](https://github.com/BookStackApp/BookStack/commit/751934c84a3e4c0482ca8086997c485ee6d6f077) Search: Tested changes to single-table search ### 📊 Changes **11 files changed** (+338 additions, -115 deletions) <details> <summary>View changed files</summary> 📝 `app/Entities/Models/Entity.php` (+13 -0) ➕ `app/Entities/Models/EntityTable.php` (+69 -0) 📝 `app/Entities/Queries/EntityQueries.php` (+31 -2) ➕ `app/Entities/Tools/EntityHydrator.php` (+140 -0) 📝 `app/Entities/Tools/MixedEntityListLoader.php` (+1 -1) 📝 `app/Search/SearchApiController.php` (+5 -4) 📝 `app/Search/SearchController.php` (+8 -6) 📝 `app/Search/SearchRunner.php` (+63 -97) 📝 `resources/views/search/all.blade.php` (+1 -5) 📝 `tests/Api/SearchApiTest.php` (+1 -0) 📝 `tests/Search/EntitySearchTest.php` (+6 -0) </details> ### 📄 Description This PR aims to change how searches are done, to use a single core query instead of a query per entity type. This should make the search more efficient, while resulting in a stable & consistent response item count. ### Todo - [x] Debug large response processing time gap between making the queries, and rendering the views. - [x] Update API search endpoint description. - [x] Address remaining TODOs - [x] Test other search controller methods (anything which uses SearchRunner). - [x] Test edge-case scenarios (different search types, filtered entity types, no tags in results, no parent items etc...) - [x] Testing --- <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:36:08 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6585