Skip to content

Develop filename#33

Open
Jarrettluo wants to merge 37 commits into
developfrom
develop-filename
Open

Develop filename#33
Jarrettluo wants to merge 37 commits into
developfrom
develop-filename

Conversation

@Jarrettluo
Copy link
Copy Markdown
Owner

No description provided.

Jarrett and others added 30 commits April 25, 2026 17:51
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Service层不再构建VO,Controller层负责组装

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Tag.java 新增 color (String) 字段
- SearchDocument.java 新增 tagNames (List<String>) 和 categoryName (String) 字段
- 均为 @field(type = FieldType.Text, analyzer = "ik_smart")

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 新增SearchQuery请求参数类(搜索关键词、全文检索、分词、标签筛选等)
- 新增DocSearchVO响应VO类(文档ID、名称、大小、描述、标签等)
- 新增TagColorVO标签颜色VO类

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add searchDocuments(SearchQuery) method to ElasticService interface
- Implement multi-condition search logic in ElasticServiceImpl:
  - fullText=true: search name + content + tagNames + categoryName
  - fullText=false: search only name
  - searchType: all/name/description field selection
  - Empty keyword returns all documents with pagination
- Returns list of matching document IDs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
实现完整搜索流程:
1. ES 检索文档ID (using ElasticService.searchDocuments)
2. MySQL 关系表过滤 (tags/category 筛选)
3. 排序: sortField (createTime/size/name) + sortOrder (asc/desc)
4. 分页: page + pageSize
5. 组装结果: liked/collected/tags/sizeDisplay

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 将 search 接口从 GET 改为 POST
- 使用 SearchQuery 作为请求体参数
- 添加 @Permission(PermissionEnum.USER) 注解要求登录
- 从 request 属性获取 userId 并传递给 service

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 新增indexDocumentToEs方法:文档上传时构建SearchDocument并索引到ES
- 新增getTagNamesByDocId方法:获取文档关联的标签名称列表
- 新增getCategoryNameByDocId方法:获取文档关联的分类名称
- 新增updateFileContentToEs方法:文本提取完成后更新ES中的文档内容
- documentUpload方法增加ES索引调用
- uploadByUrl方法增加ES索引调用
- 确认remove方法已有elasticService.deleteById调用

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…patibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ES documents were indexed with MD5 as ID but MySQL queries used UUID,
causing search results to be empty. Now ES and MySQL both use document.getId().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add SearchResultVO containing total and items list
- Change SearchResultItem.highlightFragment to highlightFragments (List<String>)
- Add searchDocumentsFullText method supporting tagId/categoryId filtering
- Extract up to 3 highlight fragments from content
- Add overloaded extractHighlightFragment with position parameter
- Update DocumentServiceImpl to use new list-based highlightFragments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Added filterWord check at start of list() method to route to ES
- Added searchFullText() private method that:
  1. Calls elasticService.searchDocumentsFullText()
  2. Fetches document details from MySQL via findByIdList()
  3. Builds highlight map and sets description with "\n---\n" delimiter
- Added searchDocumentsFullText() to ElasticService interface
- Matches plan: ES检索时高亮片段分段存入description字段

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Jarrett and others added 7 commits April 28, 2026 18:57
- Add 5 new VO classes for statistics responses
- Extend StatsVO with userNum, downloadNum, searchNum, viewNum
- Add MyBatis queries for docTypeDist and categoryDist
- Add 5 new endpoints: docTypeDist, categoryDist, hotDocs, searchHotWords, userActivity
- Fix compilation: change queryById to findById

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant