Spotlight search part of a file name?

Example: Your filename: file_developer.jpg

Problem: Search doesn’t recognize this when you use the regular search bar.

Solution: Quick and Easy Way

Do Cmd + F in a Finder Window, then under the search parameters, select Name > Contains > and Kind > Images.

———————-

Code Happy Way:

If you do Cmd + F in a Finder Window, then under the search parameters, select Raw Query (open the Kind menu, then select Other… then choose Raw Query from the dialogue box), you’ll have much more flexibility in searching for wildcard modified terms.

For example, in the Raw Query field you can put:

Code:

(kMDItemFSName == “*1234*”)

and your search will be limited to files with that sequence of numbers in the filename. You can further refine it by adding a second parameter on the same line, such as:

Code:

(kMDItemFSName == “*1234*”) && (kMDItemFSName == “*.jpg”)

Once you get the results you’re after, save this as a Smart Search for future use. Everytime you open the Smart Search file, it’ll display an up-to-date list of files matching that criteria.

Menu-bar Spotlight isn’t setup for partial name searching (where the text for which you’re looking is embedded in the file name, not starting it off.)