Advanced Searches

FoxTrot Professional Search provides extremely powerful search capabilities, some of which require a certain amount of dexterity. Here are a few example cases:


FoxTrot Queries

You may use one or multiple basic criteria (e.g. [includes all of the words], [includes at least one of the words] etc) to express your query, but you can also use matches the FoxTrot query to express it in a single text string. The syntax of these queries is documented in the Help menu.


Browse All Documents

Instead of searching for some specific keywords, you may want to browse your entire indexed dataset (or just a subfolder), and use the Categorization pane to focus on specific files.

To do this, use the all items of type criterion, with any file or folder type.

This can be useful especially when using the thumbnails mode for the result list.


Search by File Name

You may use the file name criterion, but sometimes this is not precise or flexible enough. In this case, use then apply advanced filter instead (or as a complement). If you do not use any other search criterion, then FoxTrot will suggest to add an any file or folder criterion, as filters can only be used in addition to another criterion, but this will be slower.

Once then apply advanced filter is selected, you may use some basic operators (contains, starts with, ends with…) or even some very powerful regular expressions1, on either the file name, its extension, or the full path (or even on the entire file contents).

Please note that file name filters, like other criteria, are applied to the the index and not directly to the filesystem; thus if some files have been added, deleted, moved or renamed since the index was updated, the results won't reflect those changes. Similarly, you can't search for files in an unindexed folder; but you can search an unmounted volume.

Here are a few examples:


Neighboring Words

The includes neighboring words criterion can be used to find multiple words that occur near each other. You can use either single words, quoted strings, or wildcards, for example:


Dates

There are two very different ways to search for files created, or modified, in a given date range: categorizing, and filtering.

Categorizing by Date

FoxTrot uses some predefined date ranges, such as yesterday, this month, two years ago etc. All documents found are categorized according to these ranges, and a histogram chart shows how they are distributed. The height of each bar indicates how many documents were found in that date range, and the saturation of the bar’s color indicates the average relevance of those documents. Note that some documents may belong to more than one range: 6 months ago may overlap with last year. You may select one or more predefined ranges in the chart. Use the contextual menu to toggle between modification and creation dates, and to choose the graph's vertical scale.

Filtering by Date

For a more precise date search, use then filter by date. You can then search for any arbitrary date range, either relative (e.g. less than 5 weeks ago) or absolute (e.g. after January 24, 2020).

Searching for Dates as Regular Expressions

In addition, you may also use the regular expression1 engine to search for some date strings within document contents, or file names. For example:


Partial Words, Case, Accents, Punctuation and Special Characters

By default, FoxTrot searches only for whole words (i.e. whole strings of consecutive alphabetic and numeric characters) that match the words in your query. It ignores case and accents, and treats punctuation characters as word separators.

More specifically, a word (or a “textual entity”, to use a term with no linguistic meaning) is defined as a sequence of consecutive characters that fall into the following Unicode categories: Letter (Lu, Ll, Lt, Lm, Lo) or Number (Nd, Nl, No). For example, the strings [H2O] or [ft²] are both single words, whereas [eco-friendly] consists of two separate words separated by some punctuation. In addition, any Symbol character (Sm, Sc, Sk, So), as well as any Chinese, Japanese or Korean Ideographic character, and any character with a Unicode codepoint higher than U+10000 (e.g. emojis, many ancient or historical scripts, and some regional scripts that are still in use), is also considered by FoxTrot as a whole word (even when contiguous to other high codepoint, Ideographic, Symbol, Number or Letter characters).

You may search for words starting, ending, or containing a substring by using the * wildcard as a prefix or suffix: [fox*], [*trot] and [*ox*] will all find the word [FoxTrot].

In some cases, you may want to consider capitalization or accents (e.g. you don't want to find [us] when searching for [US], or to find [resume] when searching for [résumé]). You may also want to search for a sequence of words that contains some punctuation or other non-alphanumeric characters (e.g. you don't want to find [Rh-] when you search for [Rh+]; or you don't want to find [Sagittarius A] when you search for [Sagittarius A*] - and you actually want to find the * character, and not interpret it as a wildcard; or you don't want to find the IP address [12.34.56.78] when you search for the phone number [12-34-56-78]).

In these cases, use includes the exact string. However, there are some important limitations that you should be aware of:

An alternative to includes the exact string is to use then apply advanced filter with contains the string. It does not have these limitations, but is much slower. For example:

Another alternative is to use regular expressions; see below.


Regular Expressions

FoxTrot performs near-instantaneous searches because it searches for whole words (or parts of words, when using * wildcards) in its index. In some situations, you can't express your query in terms of whole words or parts of words, but you may express it using regular expressions1. Because FoxTrot stores a compressed version of the plain text content of your documents, it can also perform this type of unindexed search very efficiently; it typically takes only a few seconds to process gigabytes of documents. Whenever possible, use some restrictive criteria before applying a regular expression filter, but if necessary, use the [all items of type] [any file or folder] criterion:


Extended Attributes

Custom metadata attributes can be added to any file using extended attributes, either by third-party applications, or from the terminal. These extended attributes are indexed by FoxTrot, and can be found as part of the other metadata field. For example, to add a publication.year attribute to a file, type the following command in Terminal.app (replace year and path with the actual publication year and path of your file):

xattr -w com.apple.metadata:publication.year "year" path

To search for a specific custom attribute, add a [then filter by Spotlight attribute] criterion, select [other Spotlight attribute…] from the popup menu, click the [Add…] button, enter the extended attribute key (without the "com.apple.metadata:" prefix), as well as a human-readable name and description, and click [Add]. Make sure the [in menu] checkbox for this attribute is checked, and click [OK]. Then select this attribute in the [then filter by Spotlight attribute] criterion popup menu.

When you use [then filter by Spotlight attribute], the value of that attribute should appear in the excerpt column.


  1. see wikipedia, or regex101.com. FoxTrot is using the PCRE2 regular expression engine