[PR #5950] [CLOSED] CN.842691263858076:4061f30454fb5d46371e3aadf592e6e3_69396e9b2723543851ba3e16.693a4c9c842c36225341e261.693a4c9c54d7087bf6e31bac:Trae CN.T(2025/12/11 12:46:20) #6603

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

📋 Pull Request Information

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

Base: developmentHead: trac-test-model-seed1.6


📝 Commits (4)

  • 0ad1537 feat(阅读进度): 添加页面阅读进度跟踪功能
  • 9214fae feat(数据库): 为search_terms和entities表添加复合索引以优化搜索性能
  • ed2caec feat(阅读进度): 添加阅读进度条功能
  • 3680fd0 Merge branch 'trac-test-model-seed1.6' of github.com:gorvi/BookStack into trac-test-model-seed1.6

📊 Changes

8 files changed (+329 additions, -0 deletions)

View changed files

app/Http/Controllers/Api/ReadingProgressController.php (+61 -0)
app/Models/ReadingProgress.php (+47 -0)
database/migrations/2024_05_11_000000_create_reading_progress_table.php (+38 -0)
database/migrations/2025_10_20_000000_add_search_indexes.php (+40 -0)
resources/js/components/Page/ReadingProgressBar.vue (+133 -0)
📝 resources/js/components/index.ts (+1 -0)
📝 resources/views/pages/show.blade.php (+2 -0)
📝 routes/api.php (+7 -0)

📄 Description

第一轮你已经分析了搜索性能问题并创建了数据库索引迁移文件,但仍有以下未完成事项:

需要解决的问题:

  1. 环境配置问题:迁移命令未执行成功,请先确保PHP环境正确配置
  • 尝试使用:php artisan migrate --path=database/migrations/2025_10_20_000000_add_search_indexes.php

  • 或提供替代方案(如手动执行SQL)

  1. 优化方案不完整:仅添加索引不足以将搜索时间降至1秒内,还需要:
  • 实现缓存层(Redis或文件缓存)

  • 修复SearchRunner.php中的N+1查询问题

  • 优化查询逻辑(如减少JOIN、使用分页)

  1. 缺少性能验证:未提供性能对比测试方案

具体要求:

  1. 完成数据库迁移:确保索引成功添加

  2. 实现缓存机制:创建SearchCache类并集成到SearchRunner

  3. 优化查询代码:至少修改applyTermSearch方法以减少内存使用

  4. 创建验证方案:编写简单的性能测试脚本

  5. 提供实施指南:说明如何测试优化效果

请继续完成上述任务,完成后:

  • 提供迁移执行状态

  • 展示关键优化代码

  • 说明性能验证步骤


🔄 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/5950 **Author:** [@gorvi](https://github.com/gorvi) **Created:** 12/15/2025 **Status:** ❌ Closed **Base:** `development` ← **Head:** `trac-test-model-seed1.6` --- ### 📝 Commits (4) - [`0ad1537`](https://github.com/BookStackApp/BookStack/commit/0ad15378a0f77a42b6c230e9961b974fa5360b91) feat(阅读进度): 添加页面阅读进度跟踪功能 - [`9214fae`](https://github.com/BookStackApp/BookStack/commit/9214fae7c3024eff03516e93da45a29b67296571) feat(数据库): 为search_terms和entities表添加复合索引以优化搜索性能 - [`ed2caec`](https://github.com/BookStackApp/BookStack/commit/ed2caecb7860951f859f192002858489abcecc3e) feat(阅读进度): 添加阅读进度条功能 - [`3680fd0`](https://github.com/BookStackApp/BookStack/commit/3680fd026b9b8a771b76857a64febcaab9caa47f) Merge branch 'trac-test-model-seed1.6' of github.com:gorvi/BookStack into trac-test-model-seed1.6 ### 📊 Changes **8 files changed** (+329 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `app/Http/Controllers/Api/ReadingProgressController.php` (+61 -0) ➕ `app/Models/ReadingProgress.php` (+47 -0) ➕ `database/migrations/2024_05_11_000000_create_reading_progress_table.php` (+38 -0) ➕ `database/migrations/2025_10_20_000000_add_search_indexes.php` (+40 -0) ➕ `resources/js/components/Page/ReadingProgressBar.vue` (+133 -0) 📝 `resources/js/components/index.ts` (+1 -0) 📝 `resources/views/pages/show.blade.php` (+2 -0) 📝 `routes/api.php` (+7 -0) </details> ### 📄 Description 第一轮你已经分析了搜索性能问题并创建了数据库索引迁移文件,但仍有以下未完成事项: ### 需要解决的问题: 1. **环境配置问题**:迁移命令未执行成功,请先确保PHP环境正确配置 - 尝试使用:`php artisan migrate --path=database/migrations/2025_10_20_000000_add_search_indexes.php` - 或提供替代方案(如手动执行SQL) 2. **优化方案不完整**:仅添加索引不足以将搜索时间降至1秒内,还需要: - 实现缓存层(Redis或文件缓存) - 修复SearchRunner.php中的N+1查询问题 - 优化查询逻辑(如减少JOIN、使用分页) 3. **缺少性能验证**:未提供性能对比测试方案 ### 具体要求: 1. **完成数据库迁移**:确保索引成功添加 2. **实现缓存机制**:创建SearchCache类并集成到SearchRunner 3. **优化查询代码**:至少修改applyTermSearch方法以减少内存使用 4. **创建验证方案**:编写简单的性能测试脚本 5. **提供实施指南**:说明如何测试优化效果 请继续完成上述任务,完成后: - 提供迁移执行状态 - 展示关键优化代码 - 说明性能验证步骤 --- <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:31 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6603