Spotlight is a really good search tool, and it's worth occasionally letting it build its index. You mostly only notice this when you've changes a whole bunch of files or setup the computer for the first time. It really is short-term pain for long-term gain, because Spotlight is phenomenal at finding anything on the Mac in a really short amount of time.
That being said, if you're in the dev-space, I'd recommend using Raycast instead. I've dong some cool things with it, like format my commit messages, generate UUIDs, and search my bookmarks with a command (/w dev -> my company's development application with a really long URL).