Home | Appendix

|  |  | Search Prefixes

DEVONthink supports a wide variety of searchable attributes. These include common attributes, like names or tags, but also include document or DEVONthink-specific items, like word counts or custom metadata you've defined. Similar to searching with Spotlight or some other applications, the use of search prefixes is supported. These take the form of a prefix and a prefix operator, e.g., `name:`, followed by the search term. These prefixes are automatically applied when you choose criteria in an advanced search but they can also be manually entered in the search field. Search prefixes Below is a list of the available search field prefixes as you would manually type into the search field or a script: text: Text contents in a file. metadata: The metadata for a file. name: The name of a file. This is distinct from the filename and does not include the file extension. url: The associated URL. comment: Spotlight Comments. docAuthors: The name of the sender of an email. docAuthorEmailAddresses: The email address of the sender of an email. docRecipients: The name of a recipient of an email. docRecipientEmailAddresses: The email address of a recipient of an email. docTitle: The title of a file. The title may be distinct from its name, e.g., a song title for an MP3 file. docComment: The RTF-specific comments for a file. docHeadline: A headline applied to some files. Rare. docSubject: The subject line from an email. docDescription: The description found on some files, typically images. docKeywords: The PDF or RTF specific keywords for a file. docOrganization: The company specified in imported links or vCards from the Contacts application. docCopyright: Copyright information in the metadata of a file. docAlbum: The album information from media metadata, e.g., MP3 files. docComposer: The composer information from media metadata, e.g., MP3 files. docCreator: The process or application used to create a file. docProducer: The producer of a file, usually applied to media files. aliases: Aliases applied to a file. tags: Tags applied to a file. label: The color label of a file, from 0 (no label) though 7. rating: The star rating of a file, from 0 (unrated) through 5. width: The width of a document in points, i.e., the width multiplied by 72. height: The height of a document in points, i.e., the height multiplied by 72. length: The number of pages in a file or length of a media file in seconds. size: The size of a file in bytes, KB, MB, or GB, e.g., `size >= 50 MB`. wordcount: The number of words in the contents of a file. hits: The number of times a file has been viewed or opened. filename: The name of the file in the file system, including the file extension. extension: The extension of a file, e.g., txt. kind: Supports `any`, `group`, `smartgroup`, `tag`, `ordinarytag`, `grouptag`, `text`, `rtf`, `formattednote`, `markdown`, `html`, `webarchive`, `xmlfile`, `propertylist`, `image`, `pdf`, `quicktime`, `video`, `audio`, `bookmark`, `feed`, `news`, `script`, `sheet`, `email`, and `other`. additionDate: The date the file was added to the database. creationDate: The date the file was created. modificationDate: The date the file was last modified. openingDate: The date the file was last opened. dueDate: The due date set in a Reminder for a file. md_attachments: The number of resources added to an RTFD file. md_language: An abbreviation of the detected language in the contents of a file. For a list of values, select a language in the criteria and note the abbreviation to use. md_country: An abbreviation of the country in the geolocation data for a file. For a list of values, select a country in the criteria and note the abbreviation to use. md_zipcode: The postal code detected in the geolocation data for a file. md_area: The state, province, or region detected in the geolocation data for a file. md_locality: The city detected in the geolocation data for a file. Item prefixes: These special prefixes are for state-based queries, like the locked or indexed state of items. They all follow the form of `item:<specified state>`, e.g., `item:locked`. Flag: The flag state of a file. Supports `flagged` or `unflagged`. Unread: The unread state of a file. Supports `read` or `unread`. Locking: The locking state of a file. Supports `locked` or `unlocked`. Item: A special item supporting instance states: `replicated`, `duplicated`, `indexed`, `pending`, or `tagged`. There are also two special prefixes you can use: scope: This limits where you are searching. It supports `selection` (the current group or database), referring to a database by name (in quotes), and `inboxes`. If no scope is specified, the search applies to all open databases. When used, `scope:` should be the last parameter in the query. any: When used, this allows you to specify whether to return results matching any of the criteria. This can only be used when specifying more than one search prefix, e.g., tags and filename.
Example: `additionDate>=2019-03-10 scope:selection` `tags:sync; methods scope:"Tech Stuff"` `any: name:test OR imprint {any: tags:blue; red}`
Sub-criteria searches: Yes, you may have noticed in the last example a tags search in curly braces. This creates sub-criteria for the search. This obviously extends the search options to allow creating even more complex forms. Prefix Operators Many times prefixes end with a colon, e.g., `tags:` but some use other forms, depending on the available options in the criterion. For example, words can "begin with" some characters, but a size is greater or less than a value. If you select a criterion you would see what options apply. Use the keys below to map the option to its operator. Matches, Is, Is Not: `:` is equal to the term matches. With strings-based queries, it allows for wildcards to be used. It is also used for state-based queries, like Kind. The negated form, `:!` is also supported. `==` is equal to the term is. This must be an exact match of the search term. These can be used in strings and number-based queries. The negated form, `!=` is also supported.
Example: Kind is Group → `kind:group` Item is indexed → `item:indexed` Item is not Replicated → `item:!replicated` Extension is XML Document → `extension==XML` Language is not English → `language!=en`
String Matching: These are operators that are used with string-based queries, like names or text content. These queries also support: `:<` is equal to begins with. `:>` is equal to ends with. `:~` is equal to contains. (The tilde is the second key down on the top left of an English keyboard.)
Example: Subject begins with party → `docSubject:<party` Locality ends with field → `md_locality:>field` Name contains tech → `name:~tech`
Number Matching: In addition to the `==` and `!=` operators, numbers can also use these operators: `<` is equal to the term is less than. `<=` is equal to the term is less than or equal to. `>` is equal to the term is greater than. `>=` is equal to the term is greater than or equal to.
Example: Word Count is less than 1000 → `wordcount<1000` Size is greater than 10MB → `size>10 MB` Hits is greater than or equal to 1 → `hits>=1`
Date Operators: These are operators used with date-based queries, like the creation date of files. `<` is equal to the term before. `<=` is equal to the term before or on. `>` is equal to the term later. `>=` is equal to the term later or on. `:#` is equal to the term within last number of days. The negated form, `:!#` is also supported. `:` is equal to the term is for date-based queries. Supported date options are Today, Yesterday, This Week, Last Week, This Month, Last Month, This Quarter, Last Quarter, This Year, and Last Year. The negated form, `:!` is also supported.
Example: Date Created is after January 31, 2019 → `creationDate>=2019-01-31` Date opened is not within last 5 days → `openingDate:!#5days` Date Due is not Today → `dueDate:!Today`
Date searching allows for some flexibility in formats. Time is not a required parameter, but can be specified. These searches are all equivalent:
Example: `additionDate>10 march, 2019` `additionDate>March 10, 19` `additionDate>2019-03-10 08:30:00 -0500`