MAC spotlight 重建聚焦索引
Enable/Disable spotlight 聚焦索引功能开启关闭
# Disable 关闭聚焦索引功能
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
# Enable 开启聚焦索引功能
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Enable/Disable/Erase Spotlight index 聚焦索引管理
# 测底重建:重建所有索引 根目录 / + Volumes
## Disable the index 关闭索引
sudo mdutil -a -i off
## Erase the current Spotlight index 擦除掉索引
sudo mdutil -a -E
## Enable the index 开启索引重建
sudo mdutil -a -i on
# 部分重建:重建电脑当前根目录的索引 /
## Disable the index 关闭索引
sudo mdutil -i off /
## Erase the current Spotlight index 擦除掉索引
sudo mdutil -E /
## Enable the index 开启索引重建
sudo mdutil -i on /
HELP
Usage: mdutil -pEsa -i (on|off) -d volume ...
Utility to manage Spotlight indexes.
-p Publish metadata.
-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 volumes.
-V vol Apply command to all stores on the specified volume.
-v Display verbose information.
NOTE: Run as owner for network homes, otherwise run as root.