For testint purposes I have a few partitions with a clean install of macOS, these partitions contain applications I use daily. Somtimes spotlight starts applications from that volume.. that is just super annoying I use this script to unmount them after start up.
You just have to move these files
mv nl.mauriciokruijer.unmountvolumes.plist ~/Library/LaunchDeamons/
sudo mv unmountVolumes.sh /usr/local/bin/