Advanced Query Syntax - Win32 Apps - Microsoft Docs
Advanced Query Syntax - Win32 Apps - Microsoft Docs
7 Note
Windows Desktop Search 2.x is an obsolete technology that was originally available
as an add-in for Windows XP and Windows Server 2003. On later releases, use
Windows Search instead.
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:
https://docs.microsoft.com/en-us/windows/win32/lwef/-search-2x-wds-aqsreference 1/13
10/16/2020 Advanced Query Syntax - Win32 apps | Microsoft Docs
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 phrase "last quarter,"
created by John or Joanne, and that the user saved to the folder mydocuments. The
query may look like this:
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
https://docs.microsoft.com/en-us/windows/win32/lwef/-search-2x-wds-aqsreference 3/13
10/16/2020 Advanced Query Syntax - Win32 apps | Microsoft Docs
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.
NOT social NOT security Finds items that contain social, but not
security.
Quotation marks "social security" Finds items that contain the exact phrase
social security.
7 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.
https://docs.microsoft.com/en-us/windows/win32/lwef/-search-2x-wds-aqsreference 4/13
10/16/2020 Advanced Query Syntax - Win32 apps | Microsoft Docs
isonline: report isonline:true Finds items that are online and which contain
report.
isflagged: report Finds items that are flagged (Review, Follow up,
isflagged:true for example) and which contain report.
iscompleted: report Finds items that are not flagged as complete and
iscompleted:false which contain report.
hasflag: report hasflag:true Finds items containing report and having flags.
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.
https://docs.microsoft.com/en-us/windows/win32/lwef/-search-2x-wds-aqsreference 5/13
10/16/2020 Advanced Query Syntax - Win32 apps | Microsoft Docs
Week/Month/year date:this week Finds items with a date falling within the current
date:last week week.
date:next Finds items with a date falling within the previous
month week.
date:past Finds items with a date falling within the upcoming
month week.
date:coming Finds items with a date falling within the previous
year month.
Finds items with a date falling within the upcoming
year.
kind:everything <property>:<value>
where <property> is a property listed below and <value> is the user-specified search
term.
https://docs.microsoft.com/en-us/windows/win32/lwef/-search-2x-wds-aqsreference 6/13
10/16/2020 Advanced Query Syntax - Win32 apps | Microsoft Docs
To to or toname to:bob
Cc cc or ccname cc:john
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.
https://docs.microsoft.com/en-us/windows/win32/lwef/-search-2x-wds-aqsreference 7/13
10/16/2020 Advanced Query Syntax - Win32 apps | Microsoft Docs
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.
https://docs.microsoft.com/en-us/windows/win32/lwef/-search-2x-wds-aqsreference 8/13
10/16/2020 Advanced Query Syntax - Win32 apps | Microsoft Docs
7 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.
https://docs.microsoft.com/en-us/windows/win32/lwef/-search-2x-wds-aqsreference 9/13
10/16/2020 Advanced Query Syntax - Win32 apps | Microsoft Docs
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.
https://docs.microsoft.com/en-us/windows/win32/lwef/-search-2x-wds-aqsreference 10/13
10/16/2020 Advanced Query Syntax - Win32 apps | Microsoft Docs
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.
https://docs.microsoft.com/en-us/windows/win32/lwef/-search-2x-wds-aqsreference 11/13
10/16/2020 Advanced Query Syntax - Win32 apps | Microsoft Docs
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.
https://docs.microsoft.com/en-us/windows/win32/lwef/-search-2x-wds-aqsreference 12/13
10/16/2020 Advanced Query Syntax - Win32 apps | Microsoft Docs
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.
Related topics
Reference
Perceived Types
SchemaTable
Yes No
https://docs.microsoft.com/en-us/windows/win32/lwef/-search-2x-wds-aqsreference 13/13