Discord and VSCode work smoothly for me on an M4 MBP -- not sure if it's a compatibility difference or just performance hiding the problem, though. But Spotlight file search is completely broken, rebuilding the index doesn't help, and web results are the only thing it returns. After 20 years of intense research, Apple finally caught up to Microsoft in race to make search broken and useless.
It's very possible that the hardware performance is hiding the issue. I upgraded from my 2020 intel 13" mbp (16gb of ram, 4-core i5) to 16" M4 Pro for a variety of reasons, but the basic processes of MacOS were making it nearly inoperable periodically throughout the day. I gifted the old one to my gf, and I can hear the fans spin up from across the apartment when nothing else is happening but indexing. I recall regul…
Go into preferences, spotlight and you can add folders to exclude from indexing. I add my home directory and most of the system directories and that more or less fixes the issue.