[PR #5949] [CLOSED] CN.842691263858076:537271e22ba22f41e609b56bca0953e6_693a4291842c36225341e11c.693a4caa842c36225341e274.693a4caa587023a3b2f27e6e:Trae CN.T(2025/12/11 12:46:34) #6605

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

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/5949
Author: @gorvi
Created: 12/11/2025
Status: Closed

Base: developmentHead: trac-test-model-kimi-k2


📝 Commits (2)

  • b0b6a24 feat(阅读进度): 实现页面阅读进度跟踪功能
  • 332d720 feat(搜索): 实现搜索性能优化方案

📊 Changes

18 files changed (+3280 additions, -6 deletions)

View changed files

READING_PROGRESS_GUIDE.md (+294 -0)
app/Entities/Controllers/ReadingProgressApiController.php (+137 -0)
app/Entities/Models/ReadingProgress.php (+72 -0)
app/Search/SearchCache.php (+126 -0)
📝 app/Search/SearchRunner.php (+168 -6)
database/migrations/2025_01_10_100000_add_indexes_to_search_terms.php (+46 -0)
database/migrations/2025_12_11_000000_create_reading_progress_table.php (+41 -0)
docs/search-performance-report.md (+208 -0)
resources/js/components/chapter-navigation.js (+332 -0)
resources/js/components/page-reading-progress.js (+422 -0)
resources/js/components/reading-progress-bar.js (+236 -0)
resources/js/components/user-reading-stats.js (+273 -0)
resources/js/services/reading-progress.js (+110 -0)
resources/sass/components/_reading-progress.scss (+196 -0)
📝 routes/api.php (+5 -0)
tests/Feature/ReadingProgressTest.php (+280 -0)
tests/Performance/SearchPerformanceTest.php (+160 -0)
tests/Unit/ReadingProgressComponentsTest.php (+174 -0)

📄 Description

请诊断并修复 BookStack 搜索功能的性能问题。问题描述:

  1. 大量数据(>10,000 页面)时搜索延迟 5-10 秒
  2. 复杂搜索经常超时(>30 秒)
  3. 内存使用量急剧上升

修复要求:

  1. 分析性能瓶颈(使用 Laravel Debugbar 等工具)
  2. 优化数据库查询,添加必要索引
  3. 修复 N+1 查询问题
  4. 考虑添加缓存层
  5. 将平均搜索时间降至 1 秒内

🔄 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/5949 **Author:** [@gorvi](https://github.com/gorvi) **Created:** 12/11/2025 **Status:** ❌ Closed **Base:** `development` ← **Head:** `trac-test-model-kimi-k2` --- ### 📝 Commits (2) - [`b0b6a24`](https://github.com/BookStackApp/BookStack/commit/b0b6a249aadc676dd00ccfd0d0ba500d9edc16e4) feat(阅读进度): 实现页面阅读进度跟踪功能 - [`332d720`](https://github.com/BookStackApp/BookStack/commit/332d720b63f6fd23f056b128b81e2af596f903a6) feat(搜索): 实现搜索性能优化方案 ### 📊 Changes **18 files changed** (+3280 additions, -6 deletions) <details> <summary>View changed files</summary> ➕ `READING_PROGRESS_GUIDE.md` (+294 -0) ➕ `app/Entities/Controllers/ReadingProgressApiController.php` (+137 -0) ➕ `app/Entities/Models/ReadingProgress.php` (+72 -0) ➕ `app/Search/SearchCache.php` (+126 -0) 📝 `app/Search/SearchRunner.php` (+168 -6) ➕ `database/migrations/2025_01_10_100000_add_indexes_to_search_terms.php` (+46 -0) ➕ `database/migrations/2025_12_11_000000_create_reading_progress_table.php` (+41 -0) ➕ `docs/search-performance-report.md` (+208 -0) ➕ `resources/js/components/chapter-navigation.js` (+332 -0) ➕ `resources/js/components/page-reading-progress.js` (+422 -0) ➕ `resources/js/components/reading-progress-bar.js` (+236 -0) ➕ `resources/js/components/user-reading-stats.js` (+273 -0) ➕ `resources/js/services/reading-progress.js` (+110 -0) ➕ `resources/sass/components/_reading-progress.scss` (+196 -0) 📝 `routes/api.php` (+5 -0) ➕ `tests/Feature/ReadingProgressTest.php` (+280 -0) ➕ `tests/Performance/SearchPerformanceTest.php` (+160 -0) ➕ `tests/Unit/ReadingProgressComponentsTest.php` (+174 -0) </details> ### 📄 Description 请诊断并修复 BookStack 搜索功能的性能问题。问题描述: 1. 大量数据(>10,000 页面)时搜索延迟 5-10 秒 2. 复杂搜索经常超时(>30 秒) 3. 内存使用量急剧上升 修复要求: 1. 分析性能瓶颈(使用 Laravel Debugbar 等工具) 2. 优化数据库查询,添加必要索引 3. 修复 N+1 查询问题 4. 考虑添加缓存层 5. 将平均搜索时间降至 1 秒内 --- <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:32 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6605