The solution works on any macOS version (tested on macOS High Sierra).
Use this guide to fix Spotlight using Terminal on your Mac (plus a pro Spotlight tip). If you're using Spotlight on Mac ( Command + Spacebar) to quickly open an app, document, or photo-and it doesn't work-you may need to re-index Spotlight.
Is Spotlight broken? Can't find the app, document, or photo you want using Spotlight on your Mac? You can fix it in 5 seconds using Terminal.