
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 not only supported, but encouraged. 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 the advanced search editor but they can also be manually entered in the search field. In the following list, we show the human-readable names you'd see in the criteria editor. In parentheses are the corresponding raw query values you'd type in a toolbar search or use in scripting.
text)metadata)name)url)comment)author)docAuthorEmailAddresses)docRecipients)docRecipientEmailAddresses)docTitle)docComment)docHeadline)docSubject)docDescription)docKeywords)docOrganization)docCopyright)docAlbum)docComposer)docCreator)docProducer)aliases)tags)label)rating)width)height)length)size >= 50 MB. (size)wordcount)charactercount)hits)filename)extension)any, group, smartgroup, tag, ordinarytag, grouptag, text, rtf, formattednote, markdown, html, webarchive, xmlfile, propertylist, image, pdf for all PDF documents, pdf+text matching PDF documents with a text layer, quicktime, video, audio, bookmark, feed, news, script, sheet, email, and other. (kind)
Item prefixes: These special prefixes are for state-based queries, like if items are replicants or contains aliases. They all follow the form of item:<specified state>, e.g., item:locked.
You can specify the state of items, i.e., is or is not. The available options are as follows:
replicated)duplicated)indexed)pending)tagged)The other option is specifying whether items do or don't contain a certain property. For example, you can search for items containing aliases and the item:<specified state> syntax is also used. This includes the negated form. Here are the searchable properties:
aliased)annotated)commented)item!:data, meaning the item does not contain data. (data)metadata)reminded)scripted)thumbnail)url)
Marked: Item states shown in the Flag column in the item list, e.g., locked, can be searched for. When choosing criteria in the Advanced options of the toolbar search, choose the Marked criterion. If using a raw query string, the search prefix is item:<specified state> and it's negated form, item!:<specified state>. Here are the marking options available:
flagged or unflagged.read or unread.locked or unlocked.Dates: Dates are a very commonly used property in searches, for example, if you're looking for a document you created two days ago. Here are the date-based properties you can search for. See the Date Operators in the next section for the syntax you can use with these.
added or additionDate)created or creationDate)modified or modificationDate)opened or openingDate)due or dueDate)Miscellaneous Properties: There are also more esoteric attributes you can search for, like the number of attachments in emails, or the detected language of a document.
md_originalname)md_attachments)md_annotationcount)md_encrypted==1 when a file is encrypted. (md_encrypted)md_incomingItemLinkCount)md_outgoingItemLinkCounts)md_language)md_country)md_zipcode)md_area)md_locality)There are also two special prefixes you can use:
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.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.
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.
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.)
Number Matching: In addition to the == and != operators, numbers can also use these operators:
< is equal to is less than and <= is is less than or equal to.
> is equal to is greater than and >= is is greater than or equal to.
Range Matches: For certain numerical attributes, you can use a range matching syntax, attribute:lowerLimit-upperLimit. For example, wordcount:500-1000 matches files with between 500 and 1000 words. This is identical to the longer form syntax of wordcount>=500 wordcount<=1000. Range matches can be used with: width, height, duration, length, hits, wordcount, charactercount, and size prefixes.
Date Operators: These are operators used with date-based queries, like the creation date of files.
< is equal to before and <= is before or on.
> is equal to later and >= is later or on.
:# is equal to within last and :!# is not within last. These searches default to days, but you can also use weeks, months, or years, e.g., modified:!#1weeks. Note you always use the plural form of the time component.
For dates-based queries, : is equal to is and :! equals is not.
For greater compatibility, some other combinations of operators are allowed. due:<=2020-01-03 is equivalent to due<=2020-01-03.
Named Relative Dates: You can use these terms for relative dates: Today, Yesterday, This Week, Last Week, This Month, Last Month, This Quarter, Last Quarter, This Year, and Last Year. Use these with is, before (or on), and after (or on) operators.
Date searching allows for some flexibility in formats. Time is not a required parameter, but can be specified. These searches are all equivalent: