Previously, if I searched for a file or folder with Spotlight that was located in my OneDrive folder, it would show up in the Spotlight search results with the normal folder or file icon, and then I could press cmd-enter to open the folder/file location. However, now, in Ventura, this is broken. The search results show the OneDrive app icon instead of a standard folder or file icon, and when I press cmd-enter, it takes me to the OneDrive app in my /Applications folder.
Yes, I confirm that behaviour. Must be a bug.
Yes, I noticed that, but I constantly press cmd-space to quickly search, and it's very annoying that a ton of my OneDrive files cannot be opened this way anymore! Thanks for confirming it's not just me, though. I sure hope they fix this soon.
I believe this is another bug in Command-space Spotlight.
It is all compounded by confusion about how OneDrive and "Files on Demand" work. I have loaded OneDrive (as well as Dropbox). Here is what I have found about how OneDrive works and consequent issues with Spotlight.
The storage of OneDrive files makes it difficult for Spotlight to index the content.
OneDrive stores files or placeholders in different locations. The files can be 1) only in the cloud, 2) stored locally in a hidden cache but not in the "sync root" (~/Library/CloudStorage/OneDrive), 3) stored both in the cache and the "sync root". When a file is not in the "sync root", a placeholder (name and thumbnail) is stored in the "sync root".
The "sync root" is located in ~/Library/CloudStirage, but is also shown in Finder's sidebar as "OneDrive". The two are the same.
Spotlight does index the content of files which are stored in the "sync root" - that is 3 above. It is unable to index content of files only in the local cache or only in the cloud.
So the obvious (but incomplete) solution is to go to the "sync root" (most easily done via the Finder sidebar OneDrive), select some folders, right click and choose "Always Keep on this Device". This is not sufficient, because "always on the device" can mean either in "sync root" + "cache" or just "cache". The "cache" is still on this device even if hidden. For Spotlight to work the file must be in the "Sync root".
Going back to the three states in my second paragraph:
1) Only in cloud - files/folders with the cloud and down arrow symbol: The file is not anywhere on the Mac, so Spotlight can't index the content. But there is a "placeholder" in the "sync root" and this is indexed by name.
2) On the device, but only in the cache - files/folders with both tick and cloud: Spotlight will index by name, but not any of the content.
3) On the device and in both cache and "sync root" - files and folders with tick but NOT cloud symbol. Spotlight can index theses fully.
With understanding of what Spotlight can index, lets look at opening files from a Finder search:
If Finder search can find the files (either because content has been indexed or just file name) then a double click will open the file. There will be a delay for files only in the cloud, but they will be downloaded and opened.
To get files into the "sync root" requires 1) the file is "always keep on device" and has been opened (a quicklook is not enough).
All the above is due to a) Files on Demand as defined by Apple, and b) how OneDrive has been implemented by Microsoft.
Dropbox has a slightly different (and less confusing) implementation with just two states - in the "sync root" or in the cloud. So "make available offline" means that the file is place in the sync root and fully indexed.