MacOS 10.14.6: Spotlight search displays old file names

I frequently use the Spotlight search bar in the Finder to search the contents of the current directory.


Lately, I have found that the spotlight search displays files by their old file names.


For example, I had a file that was created using the built in MacOS screenshot feature. When the file was first created, it had the name "Screen Shot 2021-02-10 at 18.11.51.jpg". I renamed it to "Mountain Project file 1.jpg" so it would be so more meaningful. However, when I search in the Finder for "Mountain Project", it displays the file by the original name of "Screen Shot 2021-02-10 at 18.11.51.jpg". rather than the new name of "Mountain Project file 1.jpg".


If I use quick look on the displayed file (in the Spotlight results), it still has the old file name. However, if I right click and select "Get info", then I can see the new name of the file.


How can I fix this, so Spotlight searches always show the current name?


I'm guessing spotlight is searching a cache that has the old name (although some of these files were renamed a month ago). I know I can delete the spotlight cache via terminal, but then spotlight would have to reindex the whole disk, which would take forever as the disk is 1tb.


Is there anyway to delete the cache just for this directory? I have tried turning on hidden files, but I can't see any spotlight cache in the directory. I have also tried adding the folder to System Preferences > Spotlight > Privacy and then removing the folder after a day, but this doesn't seem to do anything.


Thanks.

MacBook Pro 15″, macOS 10.13

Posted on Apr 13, 2021 4:16 AM

Reply
4 replies

Apr 19, 2021 10:06 AM in response to big_smile

Safe Boot, (holding Shift key down at startup), does the problem occur in Safe Mode? Could take 10 minutes.


Safe mode attempts to repair Disks & clears lots of caches & loads safe Drivers, & prevents loading of 3rd party extensions, so if Safe Mode works try again in regular boot.


Manually Rebuilding Spotlight via Terminal

If the aforementioned Spotlight control panel approach doesn’t spur a reindexation of the drive, you may need to initiate it manually through the command line. Open Terminal and use the following command string to do so:


sudo mdutil -E /

This basically asks for temporary super user status, which is why Terminal may ask you for your password (it may not if you’ve used a sudo command recently or are already logged in as a super user or root. The command asks the unix tool mdutil to reindex the spotlight database for everything on the computer, including external drives, mounted disk images, etc. To re-index only for a specific drive, use the /Volumes path. For example, for an external drive named “MiniMe,” the command would look like this:


sudo mdutil -i on /


Rebuilding a drive index can take a long time, so be prepared to wait whether you do it through the System Preference panel or the command line.


If still need be…


Open Terminal and run each of these one at a time


/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user


sudo /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -seed -lint -r -f -v -dump -domain local -domain system -domain user -domain network


killall Dock


sudo mdutil -E /


sudo mdutil -i on /


Rebuilding a drive index can take a long time, so be prepared to wait whether you do it through the System Preference panel or the command line.

Apr 14, 2021 7:30 AM in response to big_smile

Hi big_smile,


Thanks for reaching out through Apple Support Communities for help with your Spotlight search results. We're here for you!


Let's go over all options together. To start, please let us know if you've had an opportunity to restart your Mac since noticing this behavior. If not, please do so now. Here's a guide to help:


Log out, sleep, wake, restart, or shut down your Mac - Apple Support


If the issue persists, it may be that the Spotlight index isn't updating automatically, as expected. In that case, you'll want to rebuild the Spotlight index manually to prevent this issue by following the instructions in this guide:


Rebuild the Spotlight index on your Mac - Apple Support


Let us know if this helps to resolve the behavior you're seeing, or if you've got any questions whatsoever.


Have a great day.

Apr 19, 2021 5:28 AM in response to big_smile

Hi big_smile,


Thanks for confirming that the issue remains after rebuilding the Spotlight index. In that case, we can recommend backing up your data and then upgrading your Mac to the most recent version of macOS, if supported by your computer. This guide explains more about macOS Big Sur and device compatibility:


How to upgrade to macOS Big Sur - Apple Support


This guide goes over options for backing up your data:


Back up your Mac with Time Machine - Apple Support


If you find that the same issue remains after upgrading, you'll want to reach out to Apple Support directly at that point to investigate further. Here's a direct link to determine your preferred contact method:


Get Support


Take care!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

MacOS 10.14.6: Spotlight search displays old file names

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.