HoudahSpot icon

Efficient File Searches using Filters

HoudahSpot uses the Spotlight index maintained by macOS. This allows for lightning-fast file searches and enables HoudahSpot to find all kinds of files by name, text content, and metadata.

Spotlight does have its limitations. Some of these affect HoudahSpot. While HoudahSpot lets you combine any number of search criteria to hone in on specific files, you however cannot find or exclude files by their path.

You can, of course, use HoudahSpot to search in multiple folders at once. HoudahSpot also allows you to exclude folders from your search.

Screenshot: Smart Folder Exclusion
Multiple search locations. Smart exclusion

You do, however, need to list the folders you want to search or exclude. Since the Spotlight index does not know about file paths, you cannot set up a criterion on file paths.

For example, you cannot configure a search to ignore all files where some parent folder is named Temporary. You’d need to explicitly list all such Temporary folders.

Fortunately, HoudahSpot can filter search results to hide unwanted results. A single filter can prevent all Temporary files from cluttering up your file search.

Filters in HoudahSpot

Search result filters in HoudahSpot serve two purposes:

  1. Temporarily hide items so you can focus on a specific subset of your search results. E.g. you look only at files tagged Important. HoudahSpot signifies the fact that you are looking at a filtered search result by telling you how many of the total number of matches are being shown.

    Screenshot: Filtered search results
    5 files hidden from view using filters
  2. Narrow down search results in ways not possible using search criteria. Filters can, for example, match or exclude files by path and folder names. These filters also support regular expressions. You can thus show or hide results by matching their names or paths to a pattern.

Example: Exclude Unwanted Files

Let’s say you have dumped older versions of your files into a folder named Obsolete. Rather than using a single such folder, you have created a place for obsolete files in every project folder. Now you don’t want these obsolete files to show in your search results.

Set up your search as usual: key in your search criteria and tell HoudahSpot where to search. Start the search. HoudahSpot will list all matching files – including the ones filed away as Obsolete. We will use a filter to hide these.

In HoudahSpot 6, the filter options are found by clicking the filter button in the header above search results. The pop-over window lists all currently active filters. The list currently has one filter. It is not active since you have not yet provided a value or pattern.

Screenshot: Exclude obsolete files
Filter: Exclude obsolete files

We want to filter by “Folder Name in Path”. Select that option from the first pop-up menu.

In the second pop-up menu, make sure the option to use a regular expression is not checked. Select “does not contain” and type in the word Obsolete to hide all files where any parent folder has that word in its name.

Example: Find Folders by their Contents

Let’s imagine you have a backup drive where you also keep copies of your family DVDs. You are looking for video memories from your Florida trips. A search for “Florida” turns up unrelated results. A search for “VIDEO_TS” find the video subfolder of DVD backups, but you’ll see a long list of such folders – not just videos from your Florida trips.

For this example, we need to think outside the box. You want to find items having “Florida” in their name. Such a search can turn up many unwanted results. You’d see travel documents listed alongside the DVD folders you are looking for. Filters can’t remove all this clutter from your search results.

You do know that the folders you are looking for each have a subfolder named “VIDEO_TS”. We start from there.

Set up a HoudahSpot search to find folders named “VIDEO_TS” on your backup drive. Start the search. HoudahSpot will list matching folders – all DVDs, but only a few will relate to Florida trips.

Screenshot: Find video DVD backups
Search for VIDEO_TS folders in video DVD backups

We want to filter by “Folder Name”. Select that option from the first pop-up menu.

In the second pop-up menu, make sure the option to use a regular expression is not checked. Select “contains” and type in the word Florida to see only folders where the parent folder has that word in its name.

Search results will still list folders named “VIDEO_TS” rather than the “Florida – Summer 2018” and similar folders you wanted to find. The list of search results should however be much shorter and should no longer include false positives.

Screenshot: Filter by parent folder name
Filter by folder name: Florida

Navigate the search results using the up/down arrow keys. The file path is listed at bottom of the HoudahSpot window. Double-click a parent folder there to open it in Finder. Right-click or control-click to see the context menu. You can reveal the folder in Finder.

Example: Common Folder Structure

You have set up folders for every project or client you work with. Each folder has a subfolder for Work Product, a folder for Invoices, and one for Quotations. You would like to find all invoices across all client folders.

An invoice is a PDF file that sits in one of the many Invoices folders. Start with a search for PDF files. You may want to limit your search to a date range. You’ll probably find a lot of PDF files. Chances are you’ll find some in the Work Product folders too. You thus need to filter out these false matches.

We again want to filter by “Folder Name”. Select that option from the first pop-up menu.

In the second pop-up menu, make sure the option to use a regular expression is not checked. Select “contains” and type in the word Invoices. The list of search results shrinks to only PDF files at the top level of a folder named Invoices.

That may be the exact result you need. Chances are however that you have organized the Invoices folders using subfolders. In that case, you need to change the filter to work on “Folder Name in Path”.

Screenshot: Filter by folder path
Filter by folder name in path

Some folder structures – for example, subfolders by calendar year – can lend themselves to a filter on “Path”. In the example, you could limit results to certain years. At some point, a regular expression may come in handy.

 

Further reading. Example of a regular expression filter: Finding Files with Long File Names