Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
When I go into Finder and do cmd + F, which "index" am I accessing?
You are using the file and folders index. No results from Core Spotlight - e.g. no mail messages, no Apple Notes, no Apple Photos. But, for the files, you do get content searching as well as filename, tags, etc.
So is there any restriction isn getting results for files or content from .TXT or .RTF files when I use Finder and cmd + F?
The obvious text file types have their content indexed - including all the stuff you have mentioned. But not Apple Mail emails or Notes with text because they are Core Spotlight only.
How does Finder (cmd + F) compare to HoudahSpot compare to Find Any File?
Finder and HoudahSpot are using the Spotlight index. So results are the same. HoudahSpot has a different (clearer in my view) interface. You would have to try it to decide for yourself.

Find Any File is different because it scans files and folders in the file system without using any index. The big advantage is that it can search areas of the file system which are not indexed by Spotlight - examples being most of macOS itself, inside packages, your ~/Library. I suggest it is not a replacement for Spotlight, rather used for different types of search. Try it.

But for Finder (cmd + F) searches, how does it impact the results that I see?
It doesn't.

Needs:
1.) Be able to search .RTF files which is where I will be storing notes about news articles and videos - on a per item basis as discussed above.

"SomeNewsArticle.pdf"
"SomeNewsArticle_NOTES.rtf"

"SomeNewsVideo.mp4"
"SomeNewsVdieo_NOTES.rtf"

Also as show above, I have created a nifty table with Attribute-Value pairs to help me summarize the news, and to be able to search for certain things down the road.
Your PDFs and .RTFs will be Spotlight indexed by file name, tags, etc., and content. The MP4s will be by name, tags, etc., but not video content. Image files are searchable by content.
2.) Ideally the ability to search for text in my PDF'ed news articles.

This could be single search terms like "Immigration".

It could be multiple search terms like "Immigration" AND "Chicago"

It could be multiple search terms like "Immigration" OR "Chicago"

And it could be phrases like "Chicago South Side" or "Chinese Tariffs" or "The White House announced today"

(Hint: The more I can successfully find files in Finder using #2, the less I have to worry about creating my _NOTES files.)
3.) To be clear, my primary searching is to find FILES in Finder, so I can then open them up and get what I need. (I am not concerned about searching INSIDE of files, because as far as I know that feature works okay in LibreOffice or TextEdit of Firefox or using Preview for any type of document.)
Do this with Finder. You can just type (including the quotes) "immigration" AND "Chicago South Side" in the Finder search box. You might also want to specify PDF file type - "immigration" AND "Chicago South Side" kind:pDF

I easily get confused by doing the query in one line and it can be clearer to choose a single file attribute/content in the search box at top right. Then add criteria by clicking the + below the search box. Use Any, All and None to build complex queries. Hint (if you have not found it): at the end of each line in the criteria click the + after pressing and holding down the Option key.

You have lots of choice: You can build all the queries you are suggesting.

I really want to get these issues ironed out ASAP, but I need to know...

a.) Do I need to re-build my MacBook pro's Spotlight index?
Probably not. Is a Finder search by content finding the right files?
b.) Which search application would be best for my needs?
Finder is fine. HoudahSpot is just a different interface.
c.) Am I using the search capability correctly to find what I need?
I think you need to explore Finder searches with multi-line search criteria.
 
  • Like
Reactions: Ambrosia7177
That's what I'm saying, you have to check Documents in Spotlight settings, that's what is causing the issues. Searching the Documents folder won't help

My screenshot was wrong.

It should have looked like this...

1761103624800.png



And that yields 544 documents.
 

Attachments

  • 1761103496317.png
    1761103496317.png
    119.8 KB · Views: 3
Okay. So you’re getting the hang of it. But I don’t know why you’re using matches when this far we aren’t sure what that does - clearly it seems to prefer files that start with the search string
 
  • Like
Reactions: Ambrosia7177
You are using the file and folders index. No results from Core Spotlight - e.g. no mail messages, no Apple Notes, no Apple Photos. But, for the files, you do get content searching as well as filename, tags, etc.

I guess applications like Mail, Messages, Apple Notes, Photos, etc store all of their data (and meta data) inside the applications and so that is why you need a special search to find things like "emails containing 'gilby101'" right?


Finder and HoudahSpot are using the Spotlight index. So results are the same. HoudahSpot has a different (clearer in my view) interface. You would have to try it to decide for yourself.

Okay.


Find Any File is different because it scans files and folders in the file system without using any index. The big advantage is that it can search areas of the file system which are not indexed by Spotlight - examples being most of macOS itself, inside packages, your ~/Library. I suggest it is not a replacement for Spotlight, rather used for different types of search. Try it.

Some people claim (e.g. Reddit) that non-Finder apps are more accurate in searching your Mac file system. It sounds like you diagree with that for basic files and folders, right?



Your PDFs and .RTFs will be Spotlight indexed by file name, tags, etc., and content. The MP4s will be by name, tags, etc., but not video content. Image files are searchable by content.

Which was the initial motivation for creating a _NOTES file to go with every video file - you are limited in adding metadata and notes to video files and you obviously can't search the video content itself.


Do this with Finder. You can just type (including the quotes) "immigration" AND "Chicago South Side" in the Finder search box. You might also want to specify PDF file type - "immigration" AND "Chicago South Side" kind:pDF

I'm still trying to figure out why the search in the post above this one yield 545 PDF files starting with "R_" when I have like 3,000 such files...

I posted a corrected screenshot, and the results are wrong in Finder - way off.

My biggest fear out of all of this is that I create my beautiful _NOTES files, and have all of these great, well, NOTES, and my searches don't yield all of the corresponding files to my searches, thus rendering my lovely notes as useless. ;-(

Whether my issue is my Spotlight index is corrupt, or Finder isn't as reliable as you and @Mr_Brightside_@ say it is, or this is an "operator error", I need to get this fixed.

It would be nice to just be able to use Finder, although paying $6 for Find Any File won't break the bank!



I easily get confused by doing the query in one line and it can be clearer to choose a single file attribute/content in the search box at top right. Then add criteria by clicking the + below the search box. Use Any, All and None to build complex queries. Hint (if you have not found it): at the end of each line in the criteria click the + after pressing and holding down the Option key.

Yes, I looked up how to do that the other day.


Probably not. Is a Finder search by content finding the right files?

Finder is fine. HoudahSpot is just a different interface.

I think you need to explore Finder searches with multi-line search criteria.

I will keep practicing with it, but it doesn't always yield what I am looking for, and I have noticed that long ago - even when my queries are correct.

Maybe I should do an A/B test between Finder and Find Any File?
 
It’s operator error. Enable all the options in System Settings - Spotlight, force a reindex there too, and don’t use “matches” use “contains” or “is”.
 
Okay. So you’re getting the hang of it. But I don’t know why you’re using matches when this far we aren’t sure what that does - clearly it seems to prefer files that start with the search string

Okay, you got me there. I didn't notice "matches" as it is the default.

On that point, let even more madness begin...


Using "contains"

1761104765427.png


Results = 0



Switching back to the first attempt with "Matches"...

1761104869914.png


Results = 3,189

Exact same query as in the beginning where I accidentally used "matches" (by accident).

First attempt using "matches" yielded 544 files.

Second attempt using "matches" yields 3,189 files.

Everything else being constant.


Now do you believe me????



Now switch to "begins with"

1761105004283.png


Results = 3,126


This is why I have little to no confidence in the search results from Finder, and this is an extremely simple query!!

What happens when I need to search for something with a complex query like: "Show me all video files where the _NOTES files contain "No Kings" and "ICE" and "Chicago South Side" and so on and so forth...


If I am doing something wrong, please let me know, but I do not feel this is an operator error at this point...
 
Last edited:
Okay. So you’re getting the hang of it. But I don’t know why you’re using matches when this far we aren’t sure what that does - clearly it seems to prefer files that start with the search string

For whatever it is worth, "matches" appears to maybe be similar to "LIKE" in SQL...

1761105991473.png


And the difference between "matches" and "begins with" seems to account for the extra files like above.

But why did "matches" only yield 544 files the first couple of times, and now well over 3,000?

Again, I have seen a lot of people complain online about such things - even the creator of Find Any File mentions this as a reason to use his software.

I would prefer to get by with Finder, but I find such things to be unnerving...
 
Hi. I have thousands of news articles and videos that I need to use for research.

And because of the large numbr of files, I simply cannot remember everything I read/watch anymore.

So today, I am working on a TextEdit template that can be used to take notes about what I am reading/watching.
Do you know about the UNIX "locate" command? It is already installed on your Mac. It has been around for decades on all UNIX-like computers, going back to about the 1980s.



If you give it a test pattern, it will search every file on the system and give you a list of files that contain the pattern. The pattern language is quite flexible; for example, you might look for two words that are close together or have this but not that. And you can specify the subset of files to be searched.





It is also very fast because it does not actually search every file; it builds an index in the background and then searches the index.



From the terminal, type "man locate" for the manual page. Yes, the terminal, “Locate," predates the time when computers had mice and graphics, point-and-click interfaces.



That said, macOS has a feature called “Spotlight" that can do about the same thing, but the pattern language is not nearly as sophisticated.
 
  • Like
Reactions: Ambrosia7177
If you do not need a fancy user interface you can use a simple command line script.
Save this to a file and name it as searching.sh:

Code:
#!/bin/bash
if [ -z "$1" ]; then
  echo "Usage: $0 <keyword>"
  exit 1
fi
KEYWORD="$1"
for file in *.html; do
  if grep -q "$KEYWORD" "$file"; then
    echo "$file"
  fi
done

Copy this script in the folder with the HTML files and then open a terminal in that directory. In the terminal execute:

chmod +x searching.sh - run this command once, it will make the script executable

./searching.sh Bondi - this command will search for Bondi in the files

This will give a list of the files that contain the word Bondi. Also, you can omit the first letter writing the keyword. For example if you want to include in the search results bondi and Bondi , just search for ondi:
./searching.sh ondi
 
Last edited:
  • Like
Reactions: Ambrosia7177
and the difference between "matches" and "begins with" seems to account for the extra files like above.
Here is my understanding:
Matches: Looks for words starting with the characters. What is a word?
Begins with: Looks for the characters at the beginning of the file name - not the beginning of a word.
Contains: Look for the character string anywhere in the file name.
Searches are case insensitive by default.

"Matches" begs the question of how to define the start of a word. This is not obvious. But looking at my searches and yours the start of word includes at least these:
The start of the file name.
A space before the word.
A hyphen (and likely other non alphanumeric characters) immediately before the word. In "-r_" the r starts a word.
A capital letter starts a word. In "mR_" and the "C...zR_" the capital R starts a word.

References:
1. I am not able to find any Apple Support document that defines a word in this context.
2. For the difference between matches and contains: https://apple.stackexchange.com/que...atches-and-contains-in-search-criteria#438671 though this does not address how to define a word.
3. Perplexity gave me: The “Matches” search option in Finder is sensitive to word boundaries, typically matching the search term only if it appears at the start of a word or after a non-word character such as a space, dash, or underscore.
4. I can find no reference to a capital letter within a string of letters starting a word. I only have experiment and your results. Possibly chosen to assist searching in camelCase strings where I would hope to identify Case as a word.
 
  • Like
Reactions: Mr_Brightside_@
My biggest fear out of all of this is that I create my beautiful _NOTES files, and have all of these great, well, NOTES, and my searches don't yield all of the corresponding files to my searches, thus rendering my lovely notes as useless. ;-(
Don't worry. All that you need is a search which combines:
1. Name contains "_notes".
2. File Extension is rtf.
3. Some text to search for in the file content.
4. Optionally more text to search for in the file content.

The whole search can be entered in Finder's search box, as
RTF and chose Kind;
_notes and chose Name;
search word and chose Content;
another search word and chose Content.

That will list the appropriate _NOTES files and since you have named them from the file names of the real content that will lead straight to the documents. You could control-click and use Open in enclosing folder (so long as _NOTES are stored in the same folder as the main document).

When you want to automate it further, you could write scripts using the mdfind command to find the _notes files and to go straight to a list of the main documents. Such scripts could be wrapped up as Automator applications. But that is for another day.
 
Last edited:
Do you know about the UNIX "locate" command? It is already installed on your Mac. It has been around for decades on all UNIX-like computers, going back to about the 1980s.

No, have never heard of it before, but thanks for the education!


If you give it a test pattern, it will search every file on the system and give you a list of files that contain the pattern. The pattern language is quite flexible; for example, you might look for two words that are close together or have this but not that. And you can specify the subset of files to be searched.

Is this in the context of FILE NAMES, or a matter of FILE CONTENT, or both?

Is it using Regular Expressions? (If so, what flavor?)




It is also very fast because it does not actually search every file; it builds an index in the background and then searches the index.

So it sounds way better than Spotlight's index, right?



From the terminal, type "man locate" for the manual page. Yes, the terminal, “Locate," predates the time when computers had mice and graphics, point-and-click interfaces.

I read athe manual, but it is confusing...

So I open terminal, and type what?
Code:
locate [-0Scims] ??????
]



That said, macOS has a feature called “Spotlight" that can do about the same thing, but the pattern language is not nearly as sophisticated.

Have you used any of the 3rd-Party applications mentione din this thread (e.g. Find Any File, HoudahSpot, etc)?
 
Because you were also doing "Kind is PDF". Go review your screenshots.

That is a correct statement, but it seems to me that the first time I tried that second search rule wasn't in there.

I dunno, my head is spinning with all of this.

Am going to have to test the hell out of things and see if I can re-create the issues I saw before.

Maybe I am dreaming, but I am certain that Finder has lead me astray in years past, and as mentioned, if you go online there seems to be a lot of people noting that Finder sometimes yields incorrect results.

To be clear, I would prefer that I can do everything with Finder.

More testing (and learning) to follow...
 
If you do not need a fancy user interface you can use a simple command line script.
Save this to a file and name it as searching.sh:

Code:
#!/bin/bash
if [ -z "$1" ]; then
  echo "Usage: $0 <keyword>"
  exit 1
fi
KEYWORD="$1"
for file in *.html; do
  if grep -q "$KEYWORD" "$file"; then
    echo "$file"
  fi
done

Copy this script in the folder with the HTML files and then open a terminal in that directory. In the terminal execute:

chmod +x searching.sh - run this command once, it will make the script executable

./searching.sh Bondi - this command will search for Bondi in the files

This will give a list of the files that contain the word Bondi. Also, you can omit the first letter writing the keyword. For example if you want to include in the search results bondi and Bondi , just search for ondi:
./searching.sh ondi

Thank you for the code above. To be honest, that seems a little scary to me, but it might be an option.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.