Disable and Enable Spotlight to Rebuild Index on macOS
MDS is a Spotlight metadata server for macOS. It stores metadata on files and folders in a central database for Spotlight to efficiently search volumes. MDS is a daemon that runs in the background and is responsible for indexing your files and folders. It is also responsible for keeping the index up to date.
If your Spotlight index is corrupted or not working properly, you can disable and enable Spotlight to rebuild the index.
sudo mdutil -a -i off
sudo mdutil -a -i on