Spotlight 索引文件时出现问题,Finder 标签不起作用

Spotlight 索引文件时出现问题,Finder 标签不起作用

当我拿到一台运行 Ventura 的新 MacBook Pro M1 时,我将 TimeMachine 中的所有数据恢复到它。之后我发现 Spotlight 搜索无法正常运行。使用 mdutil 修复了这个问题。
现在我仍然面临这样的问题:虽然文件被标记了,但它们并没有列在 Finder 的颜色标签摘要中。当我深入研究它时,我发现 Spotlight 没有索引任何文件的任何元数据,除了以“kMDItemFS...”开头的文件。

所以我有一个标记为紫色的文件 (test.txt),紫色被称为“Test”。
调用xattr -l test.txt正确输出如下:

com.apple.FinderInfo: 
com.apple.metadata:_kMDItemUserTags: bplist00?VTest
3

但是,调用mdls test.txt输出时不显示标签属性:

kMDItemFSContentChangeDate = 2023-08-17 15:51:00 +0000
kMDItemFSCreationDate      = 2023-08-17 15:51:00 +0000
kMDItemFSCreatorCode       = ""
kMDItemFSFinderFlags       = 6
kMDItemFSHasCustomIcon     = 0
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery      = 0
kMDItemFSLabel             = 3
kMDItemFSName              = "test.txt"
kMDItemFSNodeCount         = 0
kMDItemFSOwnerGroupID      = 20
kMDItemFSOwnerUserID       = 501
kMDItemFSSize              = 0
kMDItemFSTypeCode          = ""

当我将文件复制到另一台机器时,调用mdls test.txt会输出更多元数据,包括颜色标签:

_kMDItemDisplayNameWithExtensions      = "test.txt"
com_apple_metadata_modtime             = 713980260
kMDItemContentCreationDate             = 2023-08-17 15:51:00 +0000
kMDItemContentCreationDate_Ranking     = 2023-08-17 00:00:00 +0000
kMDItemContentModificationDate         = 2023-08-17 15:51:00 +0000
kMDItemContentModificationDate_Ranking = 2023-08-17 00:00:00 +0000
kMDItemContentType                     = "public.plain-text"
kMDItemContentTypeTree                 = (
    "public.plain-text",
    "public.text",
    "public.data",
    "public.item",
    "public.content"
)
kMDItemDateAdded                       = 2023-08-17 16:16:17 +0000
kMDItemDateAdded_Ranking               = 2023-08-17 00:00:00 +0000
kMDItemDisplayName                     = "test.txt"
kMDItemDocumentIdentifier              = 0
kMDItemFSContentChangeDate             = 2023-08-17 15:51:00 +0000
kMDItemFSCreationDate                  = 2023-08-17 15:51:00 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 6
kMDItemFSHasCustomIcon                 = (null)
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = (null)
kMDItemFSLabel                         = 3
kMDItemFSName                          = "test.txt"
kMDItemFSNodeCount                     = (null)
kMDItemFSOwnerGroupID                  = 20
kMDItemFSOwnerUserID                   = 501
kMDItemFSSize                          = 0
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2023-08-17 00:00:00 +0000
kMDItemKind                            = "Reines Textdokument"
kMDItemLogicalSize                     = 0
kMDItemPhysicalSize                    = 0
kMDItemUserTags                        = (
    Test
)

Spotlight 似乎无法正确索引文件。我已经尝试过这些命令

mdutil -i off /
mdutil -i on /
mdutil -E
mdutil -X

尝试了各种顺序,但均未成功。我还能做什么?

相关内容