sudo killal mds
sudo killall -9 mds
# 1. Show volume indexing status:
sudo mdutil -s /
# If you get "Spotlight server is disabled." -> do `sudo killal mds`
# 2. Turn indexing off and on:
sudo mdutil -i off /
sudo mdutil -i on /
# 3. If step 2 is not enough — erase and rebuild index:
sudo mdutil -E /
sudo mddiagnose
/usr/bin/find / -name .metadata_never_index -maxdepth 1
/usr/bin/find /System/Volumes/Data -name .metadata_never_index -maxdepth 1
/usr/bin/find /Volumes -name .metadata_never_index -maxdepth 2