Contents     Previous: Index     Next: Workshop

A query is a file search based on file attributes and can be performed within Tracker or in Terminal. Queries are saved in "/boot/home/queries/" and by default last seven days before being purged. Note, that these aren't static result lists of your search, but are the query formulas which trigger a new search whenever you open them.

The Find window

You start a query by invoking the Find... menu either from the Deskbar menu or any Tracker window or the Desktop (which is actually a fullscreen Tracker window). The shortcut is ALT+F. You're presented with the Find window:

basic-query.png

[1] Select previous or saved queries or save the current query.
[2] Narrow down your search from "All files and folders" to specific file types.
[3] Define the search method:

[4] Select which drives to search on.
[5] Enter the search term.
[6] The expander hides/unhides the additional options.
[7] Uncheck the Temporary checkbox if you don't want this query self-destruct after 7 days.
[8] Check if your query is supposed to Include trash.
[9] Optionally, enter a name for this query if you want to save it.
[10] You can drag&drop the icon to save the query.

Basic queries - "by Name"

If you simply want to find all files on your mounted disks that match a certain pattern, simply leave the search method at "by Name", enter the search term into the text box and press ENTER.

Advanced queries - "by Attribute"

You can create more advanced queries by searching within the attributes of specific file types. For that to work, these attributes have to be indexed (see Index).

query-window.png

You start by setting the filetype from "All files and folders" to "text | E-mail" and change the search method to "by Attribute.

This adds a drop-down menu to the left of the textbox and the buttons "Add and Remove under that. From the menu you choose which attribute to query. With "Add and Remove you can query additional attributes or remove them again. These attributes can be logically linked with AND/OR.

Let's do an email query as an example:

query-window-filled.png

This is your Find window when you're looking for all emails Clara Botter has sent to you in the last two months that had in the subject "vibraphone" or "skepticality".

Even more advanced queries - "by Formula"

Typing in a formula query by hand is daunting and really quite unpractical. It still has its uses.

Take the above query by attribute of Clara's mails concerning vibraphones etc. If you have all the attributes and their search terms set, try switching to "by Formula mode and be overwhelmed by this one line query string:
formula-query.png

Once more as text, edited for readability:

(((((MAIL:from=="*[cC][lL][aA][rR][aA] [bB][oO][tT][tT][eE][rR][sS]*")
       &&(MAIL:when>=%2 months%))
       &&(MAIL:subject=="*[vV][iI][bB][rR][aA][pP][hH][oO][nN][eE]*"))
       ||(MAIL:subject=="*[sS][kK][eE][pP][tT][iI][cC][aA][lL][iI][tT][yY]*"))
       &&(BEOS:TYPE=="text/x-email"))

What's the use?

The result window

After you start a search, the Find window will be replaced by a result window. Here is an example that queried for "server":

result-window.png

Besides the grey background, result windows work exactly like any other Tracker window. Some things are worth noting:

You can assign a sensible attribute layout for query results of a specific filetype. Open the folder containing files of the filetype you'd like to create a template for and arrange the attributes how you'd like to have query results presented. Copy this layout with Attributes | Copy Attributes.

Open /boot/home/config/settings/Tracker/DefaultQueryTemplates, create a new folder and rename it to group/filetype, replacing slashes with underscores, e.g."audio_x-mp3". Open the new folder and paste in the layout with Attributes | Paste Attributes.

Contents     Previous: Index     Next: Workshop