Advanced Query Syntax PDF
Advanced Query Syntax PDF
[Windows Search 2.x is obsolete after Windows XP. Instead, use Windows Search.]
The Advanced Query Syntax (AQS) is used by Microsoft Windows Desktop Search (WDS) to help users and programmers
better define and narrow their searches. Using AQS is an easy way to narrow searches and deliver better result sets. Searches
can be narrowed by the following parameters:
Furthermore, search parameters can be combined using search operators. The remainder of this section explains the query
syntax, the parameters and operators, and how they can be combined to offer targeted search results. The tables describe the
syntax to use with WDS, as well as the properties that can be queried for each file kind displayed in the Windows Desktop
Search results window.
A search query can include one or more keywords, with Boolean operators and optional criteria. These optional criteria can
narrow a search based on the following:
The optional criteria, described in greater detail following, use the following syntax:
<scope name>:<value>
<file kind>:<value>
<property name>:<value>
Suppose a user wants to search for a document containing the phase "last quarter," created by John or Joanne, and that the user
saved to the folder mydocuments. The query may look like this:
Users can limit the scope of their searches to specific folder locations or data stores. For example, if you use several email
accounts and you want to limit a query to either Microsoft Outlook or Microsoft Outlook Express, you can use
store:outlook or store:oe respectively.
If you have a protocol handler in place to crawl custom stores, like Lotus Notes, you can use the name of the store or protocol
handler for the store. For example, if you implemented a protocol handler to include a Lotus Notes data store as "notes," the
query syntax would be store:notes.
Boolean Operators
Search keywords and file properties can be combined to broaden or narrow a search with operators. The following table
explains common operators used in a search query.
Note
The operators NOT and OR must be in uppercase and cannot be combined in one query (e.g., social OR security
NOT retirement).
Boolean Properties
Some file types let users search for files using Boolean properties, as described in the following table.
Dates
In addition to searching on specific dates and date ranges using the operators described earlier, AQS allows relative date values
(like today, tomorrow, or next week) and day (like Tuesday or Monday..Wednesday) and month (February)
values.
Users can search on specific properties of different file kinds. Some properties (like file size) are common to all files, while
others are limited to a specific kind. Slide count, for example, is specific to presentations. The following tables list these
properties by file kind.
These are properties common to all file kinds. To include all types of files in a query, the syntax is:
kind:everything <property>:<value>
where <property> is a property listed below and <value> is the user-specified search term.
Attachment
These are properties common to attachments. To limit the search to attachments only, the syntax is:
kind:attachment <property>:<value>
where <property> is a property listed below and <value> is the user-specified search term.
Contacts
These are properties common to contacts. To limit the search to contacts only, the syntax is:
kind:contacts <property>:<value>
where <property> is a property listed below and <value> is the user-specified search term.
Note
Phone numbers are indexed as entered. For example, if a user did not include a country or area code when entering the phone
number, users will not be able to locate a contact if searching with country or area code in the phone number.
Communications
These are properties common to communications. To limit the search to communications only, the syntax is:
kind:communications <property>:<value>
where <property> is a property listed below and <value> is the user-specified search term.
Calendar
These are properties common to calendars. To limit the search to calendars only, the syntax is:
kind:calendar <property>:<value>
where <property> is a property listed below and <value> is the user-specified search term.
Documents
These are properties common to documents. To limit the search to documents only, the syntax is:
kind:documents <property>:<value>
where <property> is a property listed below and <value> is the user-specified search term.
Presentation
These are properties common to presentations. To limit the search to presentations only, the syntax is:
kind:presentation <property>:<value>
where <property> is a property listed below and <value> is the user-specified search term.
Music
These are properties common to music files. To limit the search to music only, the syntax is:
kind:music <property>:<value>
where <property> is a property listed below and <value> is the user-specified search term.
Picture
These are properties common to pictures. To limit the search to pictures only, the syntax is:
kind:picture <property>:<value>
where <property> is a property listed below and <value> is the user-specified search term.
Video
These are properties common to videos. To limit the search to videos only, the syntax is:
kind:video <property>:<value>
where <property> is a property listed below and <value> is the user-specified search term.