在网络上搜索到两个解决方案
- 其一
$ sudo mdutil -a -i on
- 其二
$ sudo mdutil -E /
经过测试两个命令都是为了重建索引,所以都能解决问题
这里顺便看了一下 mdutil
都有哪些参数,他其实就是聚焦搜索的底层命令
$ mdutil -h
mdutil: invalid option -- h
Usage: mdutil -pEsa -i (on|off) -d volume ...
mdutil -t {volume-path | deviceid} fileid
Utility to manage Spotlight indexes.
-i (on|off) Turn indexing on or off.
-d Disable Spotlight activity for volume (re-enable using -i on).
-E Erase and rebuild index.
-s Print indexing status.
-a Apply command to all stores on all volumes.
-t Resolve files from file id with an optional volume path or device id.
-p Publish metadata.
-V vol Apply command to all stores on the specified volume.
-v Display verbose information.
-r plugins Ask the server to reimport files for UTIs claimed by the listed plugin.
-L volume-path List the directory contents of the Spotlight index on the specified volume.
-P volume-path Dump the VolumeConfig.plist for the specified volume.
-X volume-path Remove the Spotlight index directory on the specified volume. Does not disable indexing.
Spotlight will reevaluate volume when it is unmounted and remounted, the
machine is rebooted, or an explicit index command such as 'mdutil -i' or 'mdutil -E' is
run for the volume.
NOTE: Run as owner for network homes, otherwise run as root.
网友评论