Skip to content

The Eclectic Light Company

Macs & painting – 🦉 No AI content
Main navigation
  • Downloads
  • Freeware
  • M-series Macs
  • Mac Problems
  • Mac articles
  • Macs
  • Art
hoakley November 19, 2024 Macs, Technology

When and how to rebuild Spotlight indexes

Forcing Spotlight’s indexes to be rebuilt has become a panacea, popularly used when anything appears amiss with Spotlight. In many cases, it’s exactly the wrong response to what’s likely to be normal indexing activity. This article explains when it can sometimes be useful, and how to make more effective use of it.

Spotlight works by searching the indexes it maintains on each volume, stored in the hidden .Spotlight-V100 folder at the top level of each searchable volume. Within that folder is a property list containing the volume configuration details, and the Store-V2 folder containing a folder named using a UUID, within which are all the files composing the indexes. As those are opaque to the user they shouldn’t be tampered with.

Indexing

The process of indexing is simplest to understand when considered for a single newly created or changed file. That change is recorded in the volume’s FSEvents database, which in turn triggers an XPC call to process that file if it’s in a location within Spotlight’s scope.

Provided the changed file isn’t in an excluded location, an mdworker process should then start adding its contents to the volume indexes. To do this, it first checks what type of file it is, in terms of its UTI. If that’s incorrect, then the remainder of the steps won’t work properly. In most cases now, that means the file must have the correct extension for its type. If it doesn’t, then mdworker won’t be able to index it correctly.

Spotlight then looks up the correct mdimporter for that type. For many file types, those are provided as part of macOS and stored in the system, in /System/Library/Spotlight on the SSV. Importers for third-party apps may be in /Library/Spotlight or ~/Library/Spotlight, or in the /Library/Spotlight folder inside the app itself. To check all mdimporter plugins currently installed, use the command
mdimport -L

Spotlight importers and mdworker itself can crash when there’s a bug, or the mdimporter encounters a malformed file. If that happens, the log normally records repeated crashes and restarts of that mdworker process. If you can identify and remove the file that’s causing those, that should allow indexing to return to normal.

Once the mdworker has extracted the data from the file, that’s added to the volume’s indexes, typically reflected in a log entry from mds_stores containing the message
compressing 5686 bytes to <private>
or similar, for each file that has had content extracted and added to the indexes. Other services involved include mdsync and mdwrite.

Recent versions of macOS can extract additional information from certain types of files such as images and PDFs. This includes text recognised within images using Live Text, and object recognition and classification, performed in the background by other services such as photoanalysisd. Those are slower and take significantly more processing, and are normally run after mdimporter extraction.

When might it be useful to rebuild indexes?

The only indication for rebuilding Spotlight indexes on a volume is when they are known to be damaged or corrupted, in which case rebuilding offers the best chance of restoring normal search function to that volume.

One way to check the functional integrity of indexes is to perform searches for known targets, a feature available in my free Mints. I added this when the system mdimporter for Rich Text had a bug that effectively made searching the contents of any RTF file impossible, thankfully a rare situation, although third-party mdimporters may not be as reliable.

In the past rebuilding indexes was often used when mdworker processes repeatedly crashed when trying to extract index data from a file. However, that relied on the assumption that those crashes wouldn’t recur. If they did, then rebuilding wouldn’t solve the problem. One way to investigate this further is to discover from the log which file is causing mdworker workers to crash, and removing the cause. This isn’t as straightforward now, as log entries no longer identify the file(s) causing the problem unless privacy protection is removed from the log.

Recently, it has become popular to force indexes to be rebuilt whenever Spotlight’s indexing processes appear to be taking a long time maintaining current indexes, on the assumption that starting that from scratch is going to be quicker than leaving them to complete. This isn’t likely to help, as it’s likely to force rebuilding of indexes that are already fully up to date, and indexing provides no information as to its progress. So there’s no way of telling whether allowing current indexing activity to complete would take another few seconds or days. However, it’s most unlikely that forcing full reindexing would ever be faster than allowing the completion of indexing that’s already in progress.

Rebuilding the index

To force a volume to be re-indexed, open Spotlight (or Siri & Spotlight) in System Settings and click the Search Privacy… or Spotlight Privacy… button at the bottom. Click the + button at the foot, select the volume and add it to the list, then click Done. Pause thirty seconds or so, click the Search Privacy… button again, select that volume in the list, and click the – button to remove it from the list. You don’t normally need to close System Settings or restart between adding and removing the volume.

If you prefer, you can instead use the mdutil command in Terminal. The command
mdutil -E /
erases the indexes on the Data volume and forces them to be rebuilt, and you can use the same option on other volumes.

As Spotlight indexes are maintained and stored on each volume for its contents, you’ll need to include each volume on which you want to be able to search files by their contents. Unless you have been able to identify which volume’s indexes merit rebuilding, you may have to rebuild indexes on every mounted volume, which can take many hours or days to complete.

The simplest way to check that re-indexing is taking place is to open Activity Monitor, and in its CPU view check that processes with names starting with md are taking plenty of CPU. These should include mds_stores, mdworker (often multiple copies) and mds itself. On Apple silicon, those processes run almost exclusively on E cores, and are usually obvious in Activity Monitor’s CPU History window.

Key points

  • Each volume may have its own Spotlight indexes, used when searching that volume’s contents.
  • Modern macOS indexes more extensive data, including text recognised within images, and types of object found within them. More advanced metadata take longer to analyse and index.
  • Rebuilding indexes is indicated if they are known to be damaged or corrupted.
  • If you don’t know which volume’s indexes require to be rebuilt, rebuilding them on all volumes can take many hours or days.
  • If the problem is in a file or mdimporter then it’s likely to recur during rebuilding indexes unless the file is identified and removed from indexing.
  • As there’s no way to determine progress in building indexes, forcing a rebuild is likely to take longer than allowing current indexing to complete.
  • Rebuilding is best triggered by adding the volume to Spotlight exclusions, then removing it again.
  • Alternatively, use mdutil -E [volume].
  • Check rebuilding is taking place using Activity Monitor.

Postscript

Several have commented that the Spotlight Search item opened from the menu bar can show indexing progress. That’s correct, but it doesn’t actually show all Spotlight indexing by any means. For example, on my M4 Mac mini, that shows only the first minute or so, then pretends that indexing is complete despite a further 10 minutes of intensive activity filling the E cores in CPU History, almost all of it the result of continuing Spotlight indexing activity. So what that progress bar shows is the period during which Spotlight search is unavailable, not the period of indexing.

Regarding additional mdutil commands, a quick read through the man page is informative. That makes it clear that the -E option “will cause each local store for the volumes indicated to be erased. The stores will be rebuilt if appropriate.” There is no need to halt indexing before doing that.

However, if you do use -i off before performing other mdutil commands, then you will need to turn indexing back on again using -i on before Spotlight will either recreate a deleted index directory or rebuild the indexes within that. There is absolutely no need to remove the index directory using -X if all you want to do is force the indexes to be rebuilt: -E is perfectly sufficient to do that.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to email a link to a friend (Opens in new window) Email
  • Click to print (Opens in new window) Print
Like Loading...

Related

Posted in Macs, Technology and tagged index, mdutil, metadata, rebuild, search, Spotlight. Bookmark the permalink.

35Comments

Add yours
  1. 1
    Enzo Vincenzo's avatar
    Enzo Vincenzo on November 19, 2024 at 7:48 am

    Thanks. So there is no need to use mdutil -i off to stop the indexing process before using mdutil -E / (and/or other records) to delete the indexes? Obviously restoring afterwards with mdutil -i on

    Thank you

    LikeLiked by 1 person

    • 2
      hoakley's avatar
      hoakley on November 19, 2024 at 7:55 am

      You don’t need to use those commands to control indexing: Spotlight will do it automatically. Any indexing going on at the time will automatically stop when the existing indexes are removed, and following that indexing will start again automatically. But it’s surely even simpler to do this in Spotlight settings rather than in Terminal.
      Howard.

      LikeLiked by 1 person

    • 3
      John Gilbert's avatar
      John Gilbert on November 19, 2024 at 10:40 am

      I am like you Enzo, but go one step further. As well as -i off and -E, I do a -X. That deletes the .spotlight directory so that I can really believe that Spotlight will start again with nothing.

      I can’t remember when I have had problems with Spotlight and the boot volume, but some maintenance is not uncommon on other volumes.

      LikeLiked by 2 people

      • 4
        hoakley's avatar
        hoakley on November 19, 2024 at 4:04 pm

        Thank you.
        I have added a Postscript addressing mdutil options and what they do, that you may find helpful.
        Howard.

        LikeLike

    • 5
      Enzo Vincenzo's avatar
      Enzo Vincenzo on November 19, 2024 at 12:57 pm

      Thanks John. I was not familiar with the -X flag.
      However, if you read my post in Howard’s article of 17 November, you will see that after trying everything, including manually deleting Spotlight’s hidden folders, I finally solved the problem in the simplest and most trivial way possible.
      In other words, I dragged all the disc, internal and external connected to the Mac, into Spotlight’s Privacy window (in System Settings) and removed them after a minute’s wait (in theory, a few seconds would be enough).
      The fact is that indexing, although starting completely from scratch, continued without further overloading the CPU, and a few hours later the mds_store process no longer appeared at the top of the Activity Monitor.
      Before, on the other hand, it never stopped and restarted either every time it came out of suspend, with a CPU consumption of over 200%.
      I cannot say, however, whether had a positive effect the my regeneration of LaunchServices, thanks to the command I transcribed in the post.

      https://eclecticlight.co/2024/11/17/last-week-on-my-mac-health-efficiency/

      LikeLiked by 2 people

      • 6
        hoakley's avatar
        hoakley on November 19, 2024 at 4:05 pm

        Thank you. You may find the Postscript that I have added useful.
        Howard.

        LikeLike

  2. 7
    fds's avatar
    fds on November 19, 2024 at 8:17 am

    In recent years for me, one consistent cause of the Spotlight database going out of sync with reality, necessitating the full rebuild, has been trying and failing to eject external disks. The failure to eject inevitably caused by perfectly valid causes, and my mistake, such as leaving a document from the disk opened in some app, or forgetting a Terminal window with the current working directory left inside that external disk. If I then went, “wait a second, it was actually good the disk failed to shut down and eject, I meant to make some more changes first,“ that’s when all those further modifications ended up unnoticed by Spotlight.

    Even after a successful and clean eject, then later remount, Spotlight searches would show files that have long since been removed, and no matter how many times the Finder would confirm there’s nothing actually there, nothing else I could think of would fix those ghost entries short of the full mdutil rebuild for the entire disk.

    I don’t know if the root cause has been fixed yet in intervening years, that you could end up this situation with Spotlight no longer actively updating its database for a disk, it very well might be all good by now hopefully. Alas, I’m far less diligent than Howard in testing and re-testing issues. I mostly just make a mental note, “don’t ever do that again,“ and move on.

    By the way, while the full reindexing is in process, macOS is generally good at showing a progress bar with the exact percentage completed, if you try to make a Spotlight search before it’s finished, in my experience.

    LikeLiked by 2 people

    • 8
      hoakley's avatar
      hoakley on November 19, 2024 at 4:03 pm

      Thank you. I am here referring to Spotlight in recent versions of macOS, since about Catalina or Big Sur. I have added a Postscript that addresses the progress bar that you might find informative.
      Howard.

      LikeLike

  3. 9
    EcleX's avatar
    EcleX on November 19, 2024 at 1:02 pm

    Thanks for the interesting article. Searching for something (like aaa, or whatever) after clicking Spotlight (magnification icon) on the right of Apple Manu bar will show a progress bar if the index is being rebuilt. I wonder if an application could be developed to show that as well, including time elapsed and remaining, even if approximate.

    LikeLiked by 1 person

    • 10
      hoakley's avatar
      hoakley on November 19, 2024 at 4:05 pm

      Thank you.
      You may find the Postscript that I have added informative.
      Howard.

      LikeLike

  4. 11
    David's avatar
    David on November 19, 2024 at 5:15 pm

    What is the recommendation for when there are items in the Spotlight directories that are invalid? I was having odd problems with backups and running ‘fsck’ on my backup reported multiple errors with missing extended data(?) for some inodes. Looking up the inodes to find the files found that all the files were in the Spotlight system.

    I did the ‘mdutil -E’ to restart indexing for a full rebuild, however should I remove the old spotlight information as well?

    LikeLiked by 1 person

    • 12
      hoakley's avatar
      hoakley on November 19, 2024 at 5:57 pm

      If fsck was unable to repair them, then the first option would be to delete the whole directory, perhaps using mdutil -X. That wouldn’t replace the directory and restore indexing without mdutil -i on, or (perhaps oddly) mdutil -E, though. I think it would also be worth discovering whether that was the sole cause of the backup problems, because AFAIK Time Machine backups don’t use Spotlight, so I’m not sure how file system oddities in the index directory would cause those problems. Was that disk becoming flakey, perhaps?
      Howard.

      LikeLike

      • 13
        David's avatar
        David on November 19, 2024 at 6:29 pm

        I’m unsure if the file system was becoming flakey. I noticed that there was a vast slowdown on the system that caused me to run various diagnostics, fsck being one. Having used UNIX since the early 70’s disk issues are where I start when things aren’t going right. 8^)

        I’ll use the -X option to force a full rebuild. It can’t hurt to toss ‘bad data’ if it is meta-data like this.

        LikeLiked by 1 person

        • 14
          hoakley's avatar
          hoakley on November 19, 2024 at 10:28 pm

          Thank you. I wish you success.
          Howard.

          LikeLike

  5. 15
    Dakotamoons's avatar
    Dakotamoons on November 19, 2024 at 5:26 pm

    Stupid question. How does running a search in the Finder differ from a spotlight search?

    LikeLiked by 1 person

    • 16
      hoakley's avatar
      hoakley on November 19, 2024 at 5:28 pm

      It doesn’t differ: that too is a Spotlight search, although it’s limited to local files in local indexes, and doesn’t include websites etc.
      Howard

      LikeLiked by 1 person

  6. 17
    Richard Hart's avatar
    Richard Hart on November 19, 2024 at 6:11 pm

    I understand your warning not to mess with Spotlight’s invisible files on the problem volume. However, sometimes it’s the only way.

    In my case, Spotlight refused to index external drives that were newly formatted and then cloned with SuperDuper. SuperDuper’s “Erase _____, then copy files from ____” does not copy the Spotlight database, because it is rarely meaningful on the destination volume. Besides, macOS creates a new folder named “.Spotlight-V100” whenever it mounts a drive for the first time.

    In my case, the System Settings trick in the Privacy sheet for Spotlight had no effect. And no Terminal command was effective in enabling indexing and search on those drives.

    I hit upon this solution:

    Step 1. In the volume root, delete this file: .metadata_never_index_unless_rootfs 
    (Spotlight’s “do not index” setting is stored here.)

    Step 2. In the folder /.Spotlight-V100, replace a line in this file: VolumeConfiguration.plist.

    On the problem drives, the plist contained these lines. It turns out that this tells Spotlight not to index this drive at all:

    <key>Exclusions</key>
    <array>
    <string>/</string>
    </array>

    I replaced these lines with this:

    <key>Exclusions</key>
    <array/>
    <key>Options</key>

    Step 3. Unmount, then remount the drive. The system reads these files once, at the time of mounting.

    Performing Step 1 without Step 2 has no effect. 
    Performing Step 2 without Step 1 has no effect. 

    Check for success: sudo mdutil -a -i on /

    LikeLiked by 1 person

    • 18
      hoakley's avatar
      hoakley on November 19, 2024 at 10:27 pm

      Thank you. In fairness, you’re not trying to rebuild the indexes, but trying to get them built in the first place.

      Looking at your solution, I’d infer that somehow in the process of ‘cloning’ that “don’t index” marker was being added to that volume. When Spotlight then comes to create its indexes, it thus sets the whole volume as an exclusion. What you’re doing is undoing that damage.

      I’m puzzled as to how that came about: did SuperDuper create or clone that marker, or maybe macOS did? That certainly wouldn’t happen with other methods of copying the volume.
      Howard.

      LikeLike

  7. 19
    JMacV's avatar
    JMacV on November 20, 2024 at 1:45 am

    It seems odd to me that the mdimporter doesn’t track the file being indexed so that if there is a crash the file can be skipped on the next pass.

    Between the possibility of mal-formed files (intentionally or otherwise) and buggy third-party importers, it would seem better than just getting repeatedly stuck on the same file.

    The Settings panel could also show a list of failed files (at least those in user-accessible locations) to help people recognize indexing problems.

    LikeLiked by 1 person

    • 20
      hoakley's avatar
      hoakley on November 20, 2024 at 8:30 am

      Thank you.
      I don’t know how the mdimporter would know this, as it’s relatively simple code in that it does what’s told, as do the worker processes that call it. Whether one of the higher services monitors this, I simply don’t know, as those problems seem to have largely gone away in more recent versions of macOS.
      Howard.

      LikeLike

  8. 21
    bryanschmiedeler's avatar
    bryanschmiedeler on November 20, 2024 at 9:14 pm

    I have always wondered 2 things about spotlight: is there any way that it can tell me if something is NOT indexed (there is no spotlight importer for it) and it it can indicate that it is corrupt. Seems like those would be a handy edition to some troubleshooting tool. My reasoning is that if I search for a word, for instance, and I just know it is in some text document somewhere, if I don’t get a hit it isn’t apparent to me what the problem is. Is there a file type that is not being indexed, or is an index corrupt?

    LikeLiked by 2 people

    • 22
      hoakley's avatar
      hoakley on November 20, 2024 at 10:17 pm

      On the first – mdimport and mddiagnose can support this, although as they’re intended for those developing mdimporter plugins, they are fairly complex to use. The basic principle is simple: identify the UTI of the file (e.g. using my UTIUtility), then discover which mdimporter handles files with that UTI. If there’s no such importer, then there’s no way for Spotlight to index that file’s contents. The great majority of file types are already covered by those bundled with macOS anyway.
      I’m not sure how anything can tell whether a file is corrupt, apart from trying to open it using the appropriate editor. I have a tool the deliberately damages files like text and images, and use that in some testing. Even the eye can find it difficult to detect damage to some images, and testing whether included text has been correctly extracted requires human assessment.
      My free utility Mints can test a range of standard file types such as Rich Text, and is thoroughly documented.
      Howard.

      LikeLike

  9. 23
    Hans-Peter Bodden's avatar
    Hans-Peter Bodden on November 21, 2024 at 3:51 pm

    To find something that is NOT indexed I wrote a small shell script to find suspicious files:

    checksp () {
    for file in “$@”
    do
    echo $file $(mdls -n kMDItemFSName “$file”)
    done
    }

    In terminal run

    checksp * | fgrep ‘(null)’ to inspect current directory

    or something more complicated like

    checksp ~/Documents/../*(.) | fgrep ‘(null)’

    LikeLiked by 1 person

    • 24
      hoakley's avatar
      hoakley on November 21, 2024 at 3:54 pm

      Thank you.
      Howard

      LikeLike

  10. 25
    thymine02rising's avatar
    thymine02rising on November 22, 2024 at 5:26 pm

    Hi Howard, I am in the process of digitizing (depaperizing) and archiving on external drives. Will you point me to any of your previous articles on best practices for using external drives – with the end result of having archives easily searchable. I try to have a good file system, and I’ve always relied on just knowing where I put things. I’d like to trust using Spotlight in Finder more. My question is about preventing problems in advance when it has to do with decades of archives. Thank you as always for all of your wonderful articles in artwork.

    LikeLiked by 1 person

    • 26
      hoakley's avatar
      hoakley on November 22, 2024 at 5:58 pm

      Although there are several alternatives, for directly-attached external storage I think Spotlight remains the obvious choice, so long as the file types are those that can be indexed by it. PDF support is now excellent in recent versions of macOS.
      However, that isn’t an archival solution. If you want indexing that has to be future-proof, then you’ll need to look at systems used by large public archives, which aren’t easy to use and (for commercial products) are expensive. I’m no expert on those – you’d need to look to the experts who do this professionally.
      Howard.

      LikeLiked by 1 person

      • 27
        thymine02rising's avatar
        thymine02rising on November 23, 2024 at 12:37 am

        Thanks Howard, Not planning on going that in-depth. Just scanning for simplifiying life also turning email strings into PDF’s for storage. I think I have a bit more to learn about spotlight and search. When I am scanning I select OCR on my printer. On iPhone scans I am hoping they are searchable.
        Mostly using PDF – is there anything that I should know that will cause all my scanning work to be a waste of time? For instance other formats, or anything to know about externals that will cause glitches? Thought you might have run across things that I should be wary of! Any pointers will be greatly appreciated! Gratefully yours ! N

        LikeLiked by 1 person

        • 28
          hoakley's avatar
          hoakley on November 23, 2024 at 3:46 pm

          They’re all straightforward, and best using Spotlight, as that can search both the OCRed content and the original scanned images. I plan on running some more tests with Sequoia’s enhanced features, but even Sonoma is very effective with PDFs.
          Howard.

          LikeLike

      • 29
        thymine02rising's avatar
        thymine02rising on November 23, 2024 at 7:24 pm

        Thank you Howard, Not sure if hitting the “like” button is registering! Maybe there is a delay. Then if I press it again it goes away?

        Just know I like every time I hear back from you and am grateful and amazed.

        LikeLiked by 1 person

  11. 30
    mischosch's avatar
    mischosch on November 25, 2024 at 2:51 pm

    Hi there, I do have a problem, that might be connected to Spotlight indexes, but I’m not absolutely sure about that. Since upgrading to Sonoma I do have problems using search inside Apple Mail and Calendar. Triggering a search inside Mail just does not work (writing inside search field does not have any effect). I searched the internet for that, found a lot of messages of people having similar problems. I tried erasing indexes, tried erasing spotlight files. Starting in safe mode, all that voodoo stuff. I tried a lot of all the possible solutions people posted out there. Spotlight in finder seems to work in some way, so the indexes seem to work somehow. I downloaded mint and ran the test: worked fine. Using the search (cmd+search) is buggy, too, sometimes it works for searching apps, doing math calculations, etc. Sometimes not. As soon as there this a minor OS update, the mail search is working shortly directly after the update. But it stops soonish. So the update process is doing something to get that search functionality back on track. No idea, what exactly it is doing.Problem is on two different Sonoma machines, and behavior is quite identically. Do you have any idea, how to debug that further? Missing search functionality in mail app is really a problem in daily work and I I have no idea, how to debug that problem further. Mail and Calendar search seems to be connected to spotlight indexes, but not sure how that is working in detail. If you can offer any tips or insights on that or can point me to professional support to get that debugged further would be awesome! Thanks in advance.

    LikeLiked by 1 person

    • 31
      hoakley's avatar
      hoakley on November 25, 2024 at 8:20 pm

      In-app Mail and Calendar search are run by a separate flavour of Spotlight, quite different from that in the Spotlight floating window or the Find feature in the Finder. Unfortunately, there are many who have experienced problems in them, and essentially no known solutions that I’m aware of. Most of the suggested remedies either do nothing, or just waste your time and effort.
      I recommend that you contact Apple Support, as they are able to talk you through standard steps in resolution, and if necessary can escalate this so Apple can learn as well.
      I wish you success.
      Howard.

      LikeLike

  12. 32
    Kai Howells's avatar
    Kai Howells on February 18, 2025 at 12:57 am

    As a follow up to this – it’s been my experience (however I’d like it if someone else could confirm) that rebuilding or deleting the index of the root volume (e.g. sudo mdutil -E / ) does not rebuild the index for /System/Volumes/Data

    In this thread, there are people who have tried mdutil -E / and not seen any improvement, however after dragging Macintosh HD to the Search Privacy dialog in System Settings, this seems to have worked.

    In my testing, dragging Macintosh HD into the Search Privacy dialog disables indexing on BOTH / and /System/Volumes/Data

    So, to do a full rebuild on your user data, which is really where Spotlight is most needed, then the command should be sudo mdutil -E /System/Volumes/Data or sudo mdutil -aE to rebuild all indexes.

    LikeLiked by 1 person

    • 33
      hoakley's avatar
      hoakley on February 18, 2025 at 8:33 am

      Thank you. I’ll try to test that out.
      This is interesting, as this did work AFAIK. The SSV of course doesn’t have any Spotlight indexes, and they’re always on the Data volume. So the command is only purposeful if it deletes and rebuilds the whole of the indexes, covering both volumes. My recommendation above is to use System Settings anyway, and I’m not sure why anyone would want to use a command tool for this purpose, when it’s simpler in the GUI.
      Howard.

      LikeLike

  13. 34
    Someone's avatar
    Someone on June 13, 2025 at 2:34 pm

    Can anyone suggest what this Spotlight weirdness might be; external drive APFS Volume (owners not enabled), filled with 1.5TB of images organised by camera / year / month / day.

    Lots of the images are refusing to show up in spotlight finder searches / smart folders. If I add and remove the drive to spotlight privacy, they all show up again almost immediately, then within a few minutes all the same images disappear again.

    So for example, I have a date organised folder with 92 images in it, and I create a smart folder / finder search searching for files in that folder created on the date I know the files were created, and only 2 images show up. If I add / remove the drive from Spotlight privacy, all 92 images show up instantly, then a dozen mdworker_shared processes spin up in Activity Monitor, and within a couple of minutes, all bar those two images have disappeared from the smart folder again.

    It’s like Spotlight is actively hiding them, but I can’t figure out what it’s using to do that – I look in A Better Finder Attributes, and there’s nothing different about the files metadata which is any different.

    I can see there’s a 516MB .Spotlight-V100 hidden folder on the disk, which seems to get date modified modifications when I do the spotlight privacy thing.

    I tried disabling, removing, and then re-enabling spotlight for the volume via the commandline sudo mdutil -d, -X, -E, and -i on respectively (separate commands) for /Volumes/TheVolumeName which removed the .Spotlight-V100 folder, but the same problem happened – a minute of so after re-enabling indexing, all but those two special files disappeared.

    Now for the final weirdness – if I disable indexing on the volume sudo mdutil -i off /Voumes/TheVolumeName everything works perfectly with smart folders, all the images are found and everything works beautifully.

    So… why is indexing being *enabled* making finder search not work consistently for this drive, and what is going to go wrong by disabling it (will Time Machine treat it differently)?

    The only thing I can think of is I’m saving the smart folders on the drive itself, not in my user folder on the boot drive, could that be a conflict? Would the drive not being indexed cause those smart folders to not work if the drive was accessed from another Mac via File Sharing / SMB?

    LikeLiked by 1 person

    • 35
      hoakley's avatar
      hoakley on June 13, 2025 at 3:47 pm

      It doesn’t matter where you save the ‘smart folders’ – they’re just property lists containing the details of the search, as explained here. You can copy them to another Mac, if you like, where they’ll perform the same search with completely different results.

      You don’t say which version of macOS you’re using, but assuming it’s Sonoma or later, the first thing you need to do is to enable Spotlight search on the volume and leave it powered up for several days to allow full indexing to take place, including OCR within images. Another important check is to ensure that all the images are in a format for which there’s a reliable mdimporter. I gather that some RAW formats may not be supported by those bundled in macOS.

      You also don’t state which attributes you’re searching for. If you only use filenames, then you may find it simpler to use an alternative like Find Any File, which can also perform Spotlight searches on a wide range of attributes. Many find it preferable to using Spotlight. If you are going to use Spotlight, don’t use its Search box at the top right of the Find window, but set your criteria up using search bars instead, as they are more specific and clear, as explained here.

      But one of the worst things to do is to keep forcing reindexing, or disabling Spotlight, etc., particularly in more recent macOS where image contents are analysed to add to the metadata – on very large collections, that can take days to complete.

      Howard.

      LikeLike

·Comments are closed.

Quick Links

  • Free Software Menu
  • System Updates
  • M-series Macs
  • Mac Troubleshooting Summary
  • Mac problem-solving
  • Painting topics
  • Painting
  • Long Reads

Search

Monthly archives

  • December 2025 (59)
  • November 2025 (74)
  • October 2025 (75)
  • September 2025 (78)
  • August 2025 (76)
  • July 2025 (77)
  • June 2025 (74)
  • May 2025 (76)
  • April 2025 (73)
  • March 2025 (78)
  • February 2025 (67)
  • January 2025 (75)
  • December 2024 (74)
  • November 2024 (73)
  • October 2024 (78)
  • September 2024 (77)
  • August 2024 (75)
  • July 2024 (77)
  • June 2024 (71)
  • May 2024 (79)
  • April 2024 (75)
  • March 2024 (81)
  • February 2024 (72)
  • January 2024 (78)
  • December 2023 (79)
  • November 2023 (74)
  • October 2023 (77)
  • September 2023 (77)
  • August 2023 (72)
  • July 2023 (79)
  • June 2023 (73)
  • May 2023 (79)
  • April 2023 (73)
  • March 2023 (76)
  • February 2023 (68)
  • January 2023 (74)
  • December 2022 (74)
  • November 2022 (72)
  • October 2022 (76)
  • September 2022 (72)
  • August 2022 (75)
  • July 2022 (76)
  • June 2022 (73)
  • May 2022 (76)
  • April 2022 (71)
  • March 2022 (77)
  • February 2022 (68)
  • January 2022 (77)
  • December 2021 (75)
  • November 2021 (72)
  • October 2021 (75)
  • September 2021 (76)
  • August 2021 (75)
  • July 2021 (75)
  • June 2021 (71)
  • May 2021 (80)
  • April 2021 (79)
  • March 2021 (77)
  • February 2021 (75)
  • January 2021 (75)
  • December 2020 (77)
  • November 2020 (84)
  • October 2020 (81)
  • September 2020 (79)
  • August 2020 (103)
  • July 2020 (81)
  • June 2020 (78)
  • May 2020 (78)
  • April 2020 (81)
  • March 2020 (86)
  • February 2020 (77)
  • January 2020 (86)
  • December 2019 (82)
  • November 2019 (74)
  • October 2019 (89)
  • September 2019 (80)
  • August 2019 (91)
  • July 2019 (95)
  • June 2019 (88)
  • May 2019 (91)
  • April 2019 (79)
  • March 2019 (78)
  • February 2019 (71)
  • January 2019 (69)
  • December 2018 (79)
  • November 2018 (71)
  • October 2018 (78)
  • September 2018 (76)
  • August 2018 (78)
  • July 2018 (76)
  • June 2018 (77)
  • May 2018 (71)
  • April 2018 (67)
  • March 2018 (73)
  • February 2018 (67)
  • January 2018 (83)
  • December 2017 (94)
  • November 2017 (73)
  • October 2017 (86)
  • September 2017 (92)
  • August 2017 (69)
  • July 2017 (81)
  • June 2017 (76)
  • May 2017 (90)
  • April 2017 (76)
  • March 2017 (79)
  • February 2017 (65)
  • January 2017 (76)
  • December 2016 (75)
  • November 2016 (68)
  • October 2016 (76)
  • September 2016 (78)
  • August 2016 (70)
  • July 2016 (74)
  • June 2016 (66)
  • May 2016 (71)
  • April 2016 (67)
  • March 2016 (71)
  • February 2016 (68)
  • January 2016 (90)
  • December 2015 (96)
  • November 2015 (103)
  • October 2015 (119)
  • September 2015 (115)
  • August 2015 (117)
  • July 2015 (117)
  • June 2015 (105)
  • May 2015 (111)
  • April 2015 (119)
  • March 2015 (69)
  • February 2015 (54)
  • January 2015 (39)

Tags

APFS Apple Apple silicon backup Big Sur Blake Bonnard bug Catalina Consolation Console Corinth Delacroix Disk Utility Doré El Capitan extended attributes Finder firmware Gatekeeper Gérôme High Sierra history of painting iCloud Impressionism landscape LockRattler log M1 Mac Mac history macOS macOS 10.12 macOS 10.13 macOS 10.14 macOS 10.15 macOS 11 macOS 12 macOS 13 macOS 14 macOS 15 malware Metamorphoses Mojave Monet Monterey Moreau myth narrative OS X Ovid painting performance Pissarro Poussin privacy Renoir riddle Rubens Sargent security Sierra SilentKnight Sonoma SSD Swift Time Machine Tintoretto Turner update upgrade Ventura xattr Xcode XProtect

Statistics

  • 20,952,138 hits
Blog at WordPress.com.
Footer navigation
  • Free Software Menu
  • About & Contact
  • Macs
  • Painting
  • Downloads
  • Mac problem-solving
  • Extended attributes (xattrs)
  • Painting topics
  • SilentKnight, Skint, SystHist, silnite, LockRattler & Scrub
  • DelightEd & Podofyllin
  • xattred, SpotTest, Spotcord, Metamer & xattr tools
  • 32-bitCheck & ArchiChect
  • XProCheck, T2M2, LogUI, Ulbow, blowhole and log utilities
  • Cirrus & Bailiff
  • Precize, Alifix, UTIutility, Sparsity, alisma, Taccy, Signet
  • Versatility & Revisionist
  • Text Utilities: Textovert, Nalaprop, Dystextia and others
  • PDF
  • Keychains & Permissions
  • Updates
  • Spundle, Cormorant, Stibium, DropSum, Dintch, Fintch and cintch
  • Long Reads
  • Mac Troubleshooting Summary
  • M-series Macs
  • Mints: a multifunction utility
  • VisualLookUpTest
  • Virtualisation on Apple silicon
  • System Updates
  • Saturday Mac Riddles
  • Last Week on My Mac
  • sysctl information
Secondary navigation
  • Search

Post navigation

Changing Paintings: 46 Orpheus and Eurydice
Reading visual art: 174 Butterfly, narrative and symbolic

Begin typing your search above and press return to search. Press Esc to cancel.

  • Reblog
  • Subscribe Subscribed
    • The Eclectic Light Company
    • Join 8,885 other subscribers
    • Already have a WordPress.com account? Log in now.
    • The Eclectic Light Company
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • View post in Reader
    • Manage subscriptions
    • Collapse this bar
%d