July 28th, 2005 • 2:44 pm
This is something that I wasn’t aware of… We are all familiar with the use of quotation marks to search for exact phrases in a web search tool such as Google. But what about Spotlight?
Well, as far as I know, there is no easy way to search for an exact phrase with Spotlight. The quotation marks cannot be used for that purpose. But they do have a purpose, although what it is isn’t exactly clear.
According to this Mac OS X Hints hint, search for
"xxx" (including the quotation marks) in Spotlight will only return results in which the word “
xxx” appears in the file/folder name.
As far as I can tell, this is not exactly true. It does in fact return mostly files and folders with “
xxx” in their file names, but also:
- Microsoft Office documents with “
xxx” somewhere in the “Title” field in their properties (accessible through the “ ” command in the “ ” menu
- Mail messages with “
xxx” in their Subject line
- music files with “
xxx” somewhere in their tags (album title, song title, artist name, etc.)
- Spell Catcher X glossary files with “
xxx” in one of their entries
- image files with “
xxx” in their property tags
- HTML files with “
xxx” in their title (i.e. in the
That’s probably not all, but it’s all I could find with a few sample searches.
It also should be noted that the search results only include matches where “xxx” appears as a whole word, not as a partial word. In other words, if you do a search for
"intro" (with the quotes), you will only get results with the whole word “
intro” and not results with the word “
What about multiple words enclosed in quotation marks? Well, it does like Spotlight will search for the exact phrase, but only in file/folder names or the other fields mentioned above. In other words, you cannot use multiple words enclosed in quotation marks to search for a phrase anywhere in a document — only in the file name or in the properties.
For example, if you search for
"order shipped" (with quotes) in Spotlight, you get a list of results with the phrase “
order shipped” in their file/folder name or properties. You will not get results with the whole words “
order” and “
shipped” both appearing in the file/folder name or properties, but not together. In other words, you will not get messages with “
Your order has shipped” as a Subject line.
This only applies to the system-wide Spotlight menu, however. If you do a search for
"intro" (with the quotes) in Mail’s own search field, you’ll get a list of messages containing the whole word “
intro” anywhere (not just in the Subject line, but also in the body). If you do a search for
"book intro" (with quotes), you’ll get a list of messages containing both whold words “
book” and “
intro” anywhere (but not necessarily the phrase “
And if you do a search for
"order shipped" (with quotes) in Mail’s search field, you will get results with the whole words “
order” and “
shipped” both appearing anywhere in the message. In other words, you
will get messages with “
Your order has shipped” as a Subject line, but also messages with both “
order” and “
shipped” (whole words) anywhere in the body in the message.
This is all very confusing. It means that quotation marks do have a purpose in Spotlight, but that this purpose varies from application to application. It appears that the only common trait is that a search with quotation marks only searches for whole words. But whether it searches for phrases or only in the file name/properties depends on where you are.