Skip to content

修复无法用中文搜索游戏内容的问题#6129

Open
Glavo wants to merge 1 commit into
HMCL-dev:mainfrom
Glavo:chinese-search
Open

修复无法用中文搜索游戏内容的问题#6129
Glavo wants to merge 1 commit into
HMCL-dev:mainfrom
Glavo:chinese-search

Conversation

@Glavo
Copy link
Copy Markdown
Member

@Glavo Glavo commented May 20, 2026

No description provided.

@Glavo
Copy link
Copy Markdown
Member Author

Glavo commented May 20, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the search logic in LocalizedRemoteModRepository.java to use a LinkedHashSet for search filters and implements a sequential search strategy that tries keywords individually until results are found. Feedback indicates that this approach breaks pagination consistency because different pages may return results for different keywords when a pageOffset is applied.

Comment on lines +72 to +78
for (String englishSearchFilter : englishSearchFiltersSet) {
searchResult = getBackedRemoteModRepository().search(downloadProvider, gameVersion, category, pageOffset, pageSize, englishSearchFilter, getBackedRemoteModRepositorySortOrder(), sortOrder);
remoteMods = searchResult.getUnsortedResults().toList();
if (!remoteMods.isEmpty()) {
break;
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

顺序尝试多个候选关键词的搜索策略虽然提高了首页搜索的准确性,但会导致分页逻辑失效。如果第一个候选关键词的结果总数少于 pageOffset,程序会尝试下一个关键词,这使得不同页码的结果可能属于不同的搜索目标,导致分页体验不连贯。建议在文档中说明此限制,或者考虑在 pageOffset > 0 时采用不同的处理逻辑。

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