feat(search): add index-free (no_index) live search mode#9565
Open
okatu-loli wants to merge 1 commit into
Open
feat(search): add index-free (no_index) live search mode#9565okatu-loli wants to merge 1 commit into
okatu-loli wants to merge 1 commit into
Conversation
Building and maintaining a search index costs storage and periodic upkeep, and the index can lag behind the real files. For occasional searches that is overkill. Add a new search_index option "no_index" backed by a searcher that, instead of querying a prebuilt index, walks the filesystem under the requested parent on each search (bounded by max_index_depth, ignore_paths and a 1000-result cap) and matches object names against the keywords with the same case-insensitive AND semantics as the indexed backends. Index mutating methods are no-ops and AutoUpdate is off, so nothing is persisted. Existing permission/hidden-path filtering in the search handler still applies to the results. Closes AlistGo#9468
JoaHuang
approved these changes
Jun 24, 2026
This was referenced Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
需求 / Motivation
构建并维护搜索索引需要额外存储与定期维护,且索引可能滞后;对偶尔搜索的场景过重。对应 #9468。
改动 / Change
在「搜索索引」设置新增
no_index选项。选中后搜索不再查预建索引,而是从当前目录用fs.WalkFS实时遍历子树、对文件/目录名做关键词匹配(大小写不敏感、AND 语义,与索引后端一致):max_index_depth、ignore_paths约束,并对单次结果封顶 1000 条(提前中止遍历),避免大网盘打爆内存/耗时;Index/BatchIndex/...均为 no-op,AutoUpdate=false);Init/中间件无需改动(仅精确等于none才禁用搜索)。默认仍为none,零回归,需用户手动切到 No index 才启用。验证 / Verification
go build ./...、go test ./internal/search/noindex/通过。Closes #9468