Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I had a Smart Search for my Photo Stream files located at ~/Library/Application Support/iLifeAssetManagement/assets/sub/, searching for JPG and PNG files. I found that not all files were showing up. So I went looking for them myself and was able to locate them.

enter image description here

How does this make sense? Why doesn't finder see the same results? The list of files was achieved using the find command at the prompt. I then passed a simple find result to wc to get the count, 153 files found via find in Terminal but only 75 in Finder using Spotlight? What's the deal?

share|improve this question
    
Have you excluded some folders from spotlight indexing? That might explain it. –  Richard Jul 23 '12 at 14:31
add comment

3 Answers 3

up vote 4 down vote accepted

It might be necessary to rebuild the Spotlight database by running

sudo mdutil -E /

and waiting a few hours. I had the same issue in the past and rebuilding the index resolved it.

share|improve this answer
1  
Spotlight does index files located in System folders, but normally leaves them out of search results. –  l'L'l Jul 23 '12 at 14:39
    
Rebuilding the index using sudo mdutil -E / fixed the issue. Thanks! –  Chris Wagner Jul 24 '12 at 20:15
add comment

I'm not exactly clear on what you mean by "Smart Search". I'm assuming you're referring to a "Smart Folder", which allows you to specify and save Spotlight search criteria?

In Lion a Smart Folder with saved Spotlight criteria will show up in Finder as a folder with a gear icon. Smart Folders show up in ~/Library/Saved Searches/ with an extension of .savedSearch, which are actually preference lists holding aliases that create a virtual folder.

Looking at your screen capture it doesn't appear you're using a Smart Folder. Another observation is that your Finder search shows the files in the sub directory, where in Terminal you are drilling further down. Since it appears to be a standard Spotlight search it makes perfect sense why you're not seeing the same results in Finder and Terminal.

By default Spotlight does not index or search System folders, which includes the Library folder that you're searching. To resolve the inconsistency here's what you need to do:

In Finder navigate to:

  1. ~/Library/Application Support/iLifeAssetManagement/assets/sub/
  2. In the sub window click inside the search box and hit option return
  3. Search: This Mac | sub should appear just below
  4. Click sub and then + on the right side
  5. From the dropdown menu that appears select Kind is Image All
  6. Click the save button on the right and name it.

If you still aren't getting the same search results vs. Terminal then look through the search criteria options (+) to make adjustments. Hopefully this helped you, and/or anyone else that needs to setup a "smart search".

share|improve this answer
    
Yes, sorry I meant Smart Folder. I had removed and re-created it multiple times while troubleshooting which is why you do not see it in this shot. –  Chris Wagner Jul 24 '12 at 20:10
    
Regarding the search location, there was no difference, if I ran pwd on that prompt in Terminal you would see I was in the sub folder, pretty sure @patrix is correct about the cacheing. –  Chris Wagner Jul 24 '12 at 20:14
add comment

I have this all the time...

Manual search or saved search shows:

  • IMG_4668.JPG
  • IMG_4663.JPG
  • IMG_4662.JPG
  • IMG_4661.JPG

and in the /assets/sub folder I see all the files. (including IMG_4664/5/6/7.JPG etc)

After running the following command everything is fine but it will take only a week or so before it's messed up again.

sudo mdutil -E /

Same applies to the ~/Library/Mobile Documents/ folder. Multiple tests on other folders are succesfull. Just not the results for these 2 folders that both happen (?) to be under ~/Library/

Old Macbook and my new (freshly installed) Macbook: same issue

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.