This behavior changed in macOS Big Sur AFAIK. It drives me crazy. I have not found a way to make it work as it used to.
I write code (java mostly, but other stuff too). To open a source file I frequently rely on Spotlight to open a file.
A beautiful thing—if I want to open LensParser.java, I’d start typing “LensP...” and up pops LensParser.java, I hit BBEdit., and I’m now looking at the file in my text editor
So far so good. But for various reasons, I sometimes have the full source file name. Using that, Spotlight figures that I want to do a useless web page search for lensparser.java, which does not exist—it’s just some useless web search link.
I sometimes wonder how many people Apple hires whose jobs it is to figureout how to degrade usability.