Weird Spotlight bug?

The internal hard drive on my Mac Studio is divided into 2 volumes: a startup volume and one that primarily holds my media (music, photos, etc.). When I do a spotlight search on the Media volume, I get screwy results: The name of a music file is mistakenly linked to a photo, etc.

Oddly, I maintain a back-up of the media volume — and when I do a search of the back-up, all works perfectly.

I assumed this meant I needed to rebuild the spotlight index for the main volume. I tried the method where I add and then remove the volume from the privacy list in Spotlight System Setting. This had no effect.

I haven’t tried Terminal yet. Before I did, I thought I would ask here for suggestions. Thanks as always.

If that drag/drop method fails, then the next step would be to run mdutil commands from a terminal.

See also: easiest way to force spotlight reindex | MacRumors Forums

Relevant commands:

  • Turn off Spotlight indexing
    • For a single volume: sudo mdutil -i off <mountpoint>
    • For all volumes: sudo mdutil -a -i off
  • Turn on Spotlight indexing
    • For a single volume: sudo mdutil -i on <mountpoint>
    • For all volumes: sudo mdutil -a -i on
  • Erase the index (it will later be rebuilt):
    • For a single volume: sudo mdutil -E <mountpoint>
    • For all volumes: sudo mdutil -a -E

Type man mdutil for the built-in documentation for the mdutil command.

1 Like

Actually, when I wrote my initial post, I forgot that I had tried the erase command in Terminal (sudo mdutil -E /VolumePath). Sorry. It too had no effect.

A bit more info: Turning off searching for the volume seems to work OK. Spotlight stops showing any results. The problem seems to be that when I re-enable searching, it does only that (turns searching back on). I see no evidence that any rebuilding of the index is occurring (e.g., when I select to do a search immediately after re-enabling the search, there is no message that the index is rebuilding).

Well, I tried every suggested solution I could find online. None of them had any effect. So I finally gave in…and tried the nuclear option: I erased the problem drive and restored it from my backup copy. Bingo. Success. Done.

1 Like

Sorry I didn’t read this earlier. I’ve had a problem with Spotlight that’s different than yours, but my solution might have worked for you, IDK. I’m adding it to this thread in case others have a similar problem.

I bought a new M2 MacBook Air, restored from my clone, then upgraded to Sonoma 14.3.1. Finder search wouldn’t find anything if I searched inside a folder. It would only find what I was looking for if I searched at the ‘My Mac’ level. Adding folders to Spotlight’s privacy panel then removing them (which should rebuild the index) didn’t make any difference. I found the solution online in an Apple Support discussion.

Navigate in the Finder to Macintosh HD/System/Volumes/Macintosh HD (replacing ‘Macintosh HD’ with the name of your hard disk), then view all hidden files by pressing Shift-Command-Period. Find the grayed-out folder ‘.Spotlight-v100’ with a small red circle on it. Select this folder, right-click and choose ‘Move to Trash’. If prompted, enter an Admin username and password. I believe this accomplishes the same as the instructions from @Shamino to ‘Erase the index’.

Press Shift-Command-Period to hide all hidden files to declutter (it’s a toggle) and restart your Mac. Once restarted give Spotlight time to re-index your hard drive before testing the Find function. You can launch ‘Activity Monitor’ to see if the Spotlight processes (mds, mdsworker, etc.) are still indexing.

This process worked for me and now I can use Finder to search in any folder, not just in ‘My Mac’. This might have helped when you rebuilt your Spotlight index but it didn’t fix your problem.

2 Likes

An update on this issue. My success was only temporary. The problem soon returned. And now the problem exists on the backup volume as well.
When I try to enable Spotlight via the mdutil command in Terminal…it fails. It just keeps saying that “Indexing and Searching disabled.” And it’s only for this volume. Another external data volume I have works fine.

BTW: I have tried deleting the .Spotlight-V100 file. This too had no effect.

It appears there is some unknown file or setting that is preventing Spotlight from working on the problem volume. I suspect if I erased the drive…and copied over the visible files via the Finder…this would probably work. But I haven’t tried it yet.

Thank you for posting this! (apologies to the original poster as it’s no help). I’ve been fighting the “no-folder-level-searching-bug” for several weeks, and the only solutions were to re-index Spotlight, but Spotlight’s index was just fine. Searching at folder level wouldn’t work, but at the My Mac level was just fine. I deleted the Spotlight-v100 folder, restarted, and YES, folder level searching is working again. Woo-hoo!