Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Spotlight/Finder search does not find files

I'm having problems with the search in Finder windows in MacOS X 10.6.8.

If I'm typing a search keyword in the textbox in a finder window and search for "file name" or "content", I get no or only a few results, although there should be much more results.

Is this a bug in OS X?

e.g. if I activate the search for "file name" and type "a" in the text box, I get 8 results. When I search for "b" instead, I get 61 results, and 60 of them have an "a" in the file name!

Is this a known bug?
Is there a solution?

I've already tried to

  • rebuild the spotlight index with
    sudo mdutil -E PathOfPartition several times
  • repaired permissions on the startup drive

... but no change - Finder/Spotlight does not list files as results, although they exist and match the search criteria.

MacBook, Mac OS X (10.6.8), 13" 2.16 GHz white '07, 3GB, 500GB

Posted on Nov 5, 2011 10:29 AM

Reply
Question marked as Best reply

Posted on Nov 5, 2011 11:50 AM

Partial letter or phrase searches are problematic. Start with http://www.pinkmutant.com/articles/Leopard/leospot.html and http://www.thexlab.com/faqs/stopspotlightindex.html then my mod to Finder's Find at http://www.macosxhints.com/article.php?story=20080229204517495 for what you can change so you can find stuff excluded by the default structure. See http://lonestar.utsa.edu/llee/applescript/customfindSN.html for a Snow Leopard fix.


Finally, DL and peruse the Spotlight Query manual.

9 replies
Question marked as Best reply

Nov 5, 2011 11:50 AM in response to beckmart

Partial letter or phrase searches are problematic. Start with http://www.pinkmutant.com/articles/Leopard/leospot.html and http://www.thexlab.com/faqs/stopspotlightindex.html then my mod to Finder's Find at http://www.macosxhints.com/article.php?story=20080229204517495 for what you can change so you can find stuff excluded by the default structure. See http://lonestar.utsa.edu/llee/applescript/customfindSN.html for a Snow Leopard fix.


Finally, DL and peruse the Spotlight Query manual.

Nov 5, 2011 12:04 PM in response to baltwo

@baltow: Thank you for your answer!


I'm not sure if you might have misunderstood my question (or I might have asked it badly):


It's not about searching for system files (which seem to be excluded per default), but its about:


If I'm searching for files by name in a directory, spotlight will find some of them, but not all matching files!

This is not only for a one-letter search string but also for longer words, e.g.


I'm searching in a directory (with subdirectories) for file name "Anschreiben".

In Finder: 0 results

Easyfind: 44 results!


searching for pdf files with "Anschreiben" in their name:

EasyFind can find 14 in the above mentioned directory (the other 30 are not pdfs)

Spotlight will only find 8 in a system wide search!!


So somethings wrong with spotlight or its index,

but I did not see how the links you sent me should help. :-(

Can you give me a hint?

BTW the applescript with the SL fix is not available. :-(

Nov 6, 2011 1:53 AM in response to baltwo

@baltwo


thank you, I think, I'm getting nearer to the solution of the problem, but I still need help. :-|


My system setup consists of 2 partitions:

1) System partition containing MacOS X and user directories.

2) data partition which contains most of my data (but some are in the user directory).


That is not idealand it also seems to be the core of the problem.

The data partition does not have the checkbox "ignore owner on this volume" checked.

From my user account (with no admin rights) I can access (read + write) all the files that I'd like to search and find, so for my understanding, spotlight should be able to find them.

But it does not.


The example directory I wrote about in my questions is on the data partition.

I copied it to my home folder (on the system partition), et voilà:

Finder search gets the same number of results (44 in all and 14 pdfs) like EasyFind.


So far, so good.

How can I find out, what to do to fix that now for the whole data partition?

(Unfortunately, I can not just copy all the files, as the paths are still needed as they are and there also would not be enough space on the system partition.)


Can spotlight only find files for me which I own?


How can I find out who's the owner of a file?

(In the Finder info window, I can only see who has read/write permissions.)


I admit that I do not have fully understood the concept of the file permissions in OS X (resp. UNIX). What would be a good read to learn that quickly?

Nov 6, 2011 11:35 AM in response to beckmart

Launch the Terminal app in /Utilities, copy & paste this command into the window that pops up, hit the return key, at the Password: prompt carefully enter your admin user password (nothing shows up on the screen), and hit the return key again.


sudo mdutil -E /Volumes/*


This should erase all indexes and cause Spotlight to reindex all mounted volumes.


As for owners & groups, this should explain things:


User uploaded file

Nov 6, 2011 2:06 PM in response to baltwo

@baltwo:

so the first user in the info panel is the owner?

In the case of my problematic subdirectory (and my whole data partition!!!), this is:


1) user3 - write only (a new account which I created for an apple store which repaired my macbook and where I tried quickly to refuse them to read my data -maybe with messing up my permissions?!.)

2) myaccount (me) - read & write

3) System - read & write

4) admin - read & write

5) everyone - no rights


So it seems that the account "user 3" is the owner of my files and has only write access?

And this is the reason why in my account (despite of read & write access to directory and files?!) I can not find things with spotlight?!


So, firstly I will remove the account "user 3" which is not needed any more.

Do I have to repair permissions afterwards for the volumes?

And then finally, I'll try to rebuild the spotlight index?

Nov 6, 2011 5:23 PM in response to beckmart

Yes, that's about right. For your data volume, run launch the Terminal app, copy & paste this command into the window that pops up, hit the return key, at the Password: prompt, carefully type in your admin password (since nothing shows up on the screen), hit the return key, and when the normal prompt returns, quit the Terminal app:


sudo chown -R "your account name":admin /Volumes/"name of data volume"


Substitute items in parentheses with the real names. Launch System Preferences->Accounts->delete the user3 account, restart, and all should be well>

Nov 8, 2011 1:20 AM in response to baltwo

@baltwo: thank you very much!

You finally helped me solving my problem.



However, there are still 2 things I do not understand:


a) can spotlight find only find files which are owned by the current user?

(So although I have read & write permissions for some files (which I do not own) I can not search/find them?? )


b) why does the one letter search string for filenames not list everything?

Spotlight provies no warning about that and I'd consider that a but and not a feature.

Is this documented somewhere?

Spotlight/Finder search does not find files

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