Instant Search query commands reference

Starting in Outlook 2007, and continued in Outlook 2010 and Outlook 2013, the Search function in Outlook can integrate with the default Windows Search Indexer of Windows Vista, Windows 7 and Windows 8 or when you have Windows Search installed when using Windows XP.

As this is an indexed search, it allows for faster search query results than with the traditional built-in Search function in Outlook. With this change, you also have access to a lot of special search commands and index fields to refine your search.

While many of the commands and fields can also be found and selected directly within Outlook, not all of them are exposed. Additionally, you’ll have to type these commands or field names manually when searching for Outlook content via the Windows Search box outside of Outlook.

This is a reference guide to the available search operators and search fields and how to use them.


Dates

To find items based on their primary date field, you can use the before: and after: command. This usually corresponds with either when the message or other Outlook item was received, sent, created or modified. Behind this command follows a date statement that matches with the date format you have configured in Windows.

Examples:
When using the date format mm/dd/yyyy
before:1/27/2010

When using the date format dd-mm-yyyy
before:27-1-2010

Aside from the date format, you can also use words to calculate a relative date on the fly or to directly specify a date or month;

  • Direct searches relative from today;
    Today, tomorrow, yesterday
  • Combination searches relative from today;
    Use; this, next, last, past, coming
    With; week, month, year
    For instance; thisweek, nextmonth, lastweek, pastmonth, comingyear
  • Search for results on a specific day of the week;
    Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
  • Search for results in a specific months of the year;
    January, February, March, April, May, June, July, August, September, October, November, December
    You can combine this with years as well; January2010, December2009, June2006

Examples:
When using the before: or after: command;
before:June2006
after:lastmonth

See the Ranges section on how to search for items within a specific date range.

Sizes

If you are looking for items with a specific size, then you can use the size: command. When using this command, you should not forget to include the unit of size such as KB or MB.

There are a couple of words that are direct references to a specific size range;

  • Empty: 0KB
  • Tiny: 0 – 10KB
  • Small: 10 – 100KB
  • Medium: 100KB – 1MB
  • Large: 1 – 16MB
  • Huge: 16 – 128MB
  • Gigantic: >128MB

Examples:
To find all files that are exactly 5MB in size (5120KB);
size:5MB

To find all files between 1MB and 16MB;
size:large

See the Ranges section on how to search between other size ranges.

Ranges

To search in a specific date range, you could use both after: and before: commands but there is a more direct way to do this as well. The same is true for any field that allows to be searched in a specific range such as the size, sent, received and modified fields. For this you can use the following special operators between the command and its values.

OperatorExamplesResults
<size:<5MB
received:<lastweek
received:<12/31/2009
received:<31-12-2009
Returns results that are either smaller than or happened before the specified value. The value itself is not included.
=<size:<=5MB
received:=<lastweek
received:=<12/31/2009
received:=<31-12-2009
Returns results that either have the same size or are smaller than or happened on or before the specified value. In other words; the value itself is included.
>size:>5MB
received:>November2009
received:>11/1/2009
received:>1-11-2009
Returns results that are either larger than or happened after the specified value. The value itself is not included.
=>size:=>5MB
received:=>November2009
received:=>11/1/2009
received:=>1-11-2009
Returns results that either have the same size or are larger than or happened on or after the specified value. In other words; the value itself is included.
..size:5MB..10MB
received:lastweek..1/1/2010
received:May2009..July2009
received:12-4-2009..17-6-2009
Return results that have a size between or happened between the specified values. The values itself are included as well.

 

Note:
Instead of using the two dots, you can also use a combination of the >= and <= operators;
size:>=5MB<=10MB is the same as size:5MB..10MB

To exclude the specified value you can use the > and < operators;
size:>5MB<10MB

Other search operators and special values

Aside from operators to search through ranges, there are also some other operators and special values available which you can use in your search queries.

NOT operator

If you want to exclude certain search results, you can use the NOT operator;
NOT category:blue

OR operator

By default you will be searching with the AND operator which you do not have to specify in your search. You can use the OR operator if you want your search results to also include items for which only a single condition is met;
contents:presentation OR attachment:presentation

[ ] operator / Search for empty fields

If you want to find an item for which a certain value is not set, you can use the square bracket characters;
birthday:[]

You can combine this field with the NOT operator to find items for which any value is selected. For instance, to find all items which have a category assigned to it you can use;
NOT category:[]

Note:
This way of searching only works when you are searching from within Outlook 2010.
It will work for both Outlook 2007 and Outlook 2010 when searching via the Search field in Explorer or the Start Menu of Windows 7.

Search multiple values

To search for multiple values within the same field, you can separate these values with a comma ( , ) semi-colon ( ; ) or dash ( – ) or enclose them in parenthesis characters ( );
category:blue,red
category:(blue red)

This would return only results for which both specified values are found. If only one suffices, then you’ll have to use the round brackets and the OR operator;
category:(blue OR red)

Search with spaces/Search exact string

In order to search for a string that contains spaces, you’ll have to enclose it by using double quotes;
"Microsoft Office Outlook"

Note:
Do not confuse this method with the parenthesis enclosing.

subject:"Microsoft Office Outlook"
This query returns all items that have Microsoft Office Outlook in their subject.

subject:(Microsoft Office Outlook)
This query will return all items that have Microsoft Office Outlook in their subject but not necessarily in that order. This will for instance also return the result; Outlook is part of Microsoft’s Office suite. In other words, it returns any item with a subject which contains the words Microsoft and Office and Outlook.

Search partial string

You can only search for a partial string if you know the beginning of that string. If you only type the end or middle part of the string, only results that begin with that part will be returned.
For instance, if you were to look for my last name “Sparnaaij”, then typing “sparn” will give the expected results. Only typing “naaij” will not return the correct results.

Using a common wildcard character such as * will not make any difference since wildcards are not supported. As special characters are ignored in general, searching for “naaij” or “*naaij” will return the same results.

If you need to search for a partial string, then you’ll have to use Advanced Find (CTRL+SHIFT+F) within Outlook, select the Advanced tab and enter the following query;

  • Field: body
  • Condition: contains
  • Value: naaij

Of course this works the same way when using a different field to search on such as “Subject”.

Search with special characters

As the search index is based on alphabetic characters and numbers only (a-z, 0-9), special characters such as # and / at the beginning of a word will be ignored when doing a search. This means that when you are looking for a certain code such as #hto123, any result starting with hto123 will be returned.

If you want to search for a string containing special characters, then you must place the string between quotes. If you do not do this, the special character will be replaced by a space and you’d be searching for the string left from the special character and right from the special character separately;
"hto#123"


Search Field Reference

Below you’ll find all the Outlook fields that are being included in the search index. When searching just for a specific word or phrase without specifying a field, all of these fields are included. To search for something in a specific field, you can include the command corresponding to that field. Of course you can combine these with other query commands and operators and also still include words in your query without specifying a field.

Example:
from:"Robert Sparnaaij" hasattachment:false received:>lastweek outlook

This will return all items containing outlook in any field but it has to be from Robert Sparnaaij, it should not have an attachment (so the search indexer will not look in any attachments for this query) and it should be received after last week.

 

Tip!
These type of queries are particularly useful when you are searching from the Search box in the Windows Start Menu or Explorer Search box. You can also save these queries as templates so you can reuse them later or further narrow down the search with just a single additional query.

To search in Outlook from the Start Menu type; store:mapi
To search in Outlook from the Explorer Search box, double click on Microsoft Outlook in your user’s Searches folder;
• Start-> click on your username in the top right-> Searches-> Microsoft Outlook

E-mail

The following e-mail fields can be searched;

FieldCommandExample
Attachmentshasattachment,
hasattachments
hasattachment:true
Attachment Containsattachments, attachmentattachment:presentation.ppt
attachment:(presentation content)
Bcc addressbccaddress, bcc, bccnamebccaddress:mike@contoso.com
Bodycontentscontents:(presentation Monday)
Categoriescategorycategory:project
Cc addressccaddress, ccccaddress:mike@contoso.com
Due dateduedate, duedue:10/15/2008
Durationdurationduration:>120
Expiration Dateexpiresexpires:10/15/2008
Flaghasflag, isflaggedhasflag:false
Follow-up flagflagstatus
flagstatus:followup
flagstatus:unflagged
flagstatus:completed
flagstatus:followupflag
Fromfrom, organizerfrom:simon
Importanceimportanceimportance:low
importnace:normal
importance:high
In Folderfolderpathfolderpath:Inbox
Incompleteincompleteincomplete:true
Is completediscompletediscompleted:true
Message Sizemessagesize, sizemessagesize:large
Modifieddatemodifieddatemodified:10/15/2008
Readread, isreadisread:false
Receivedreceived, sentsent:yesterday
Retention Policyretentionpolicyretentionpolicy:short
Sensitivitysensitivitysensitivity:normal
sensitivity:personal
sensitivity:private
sensitivity:confidential
Sentsentsent:10/15/2008
Sent to Another Recipientrequiredattendeesrequiredattendees:mike@contoso.com
Start Datestartstart:10/15/2008
Subjectsubject, titlesubject:budget
To addresstoaddress, totoaddress:mike@contoso.com

Contacts

The following contact fields can be searched;

FieldCommandExample
Anniversaryanniversaryanniversary:yesterday
Assistant nameassistantnameassistantname:fred
Assistant’s phoneassistantsphoneassistantsphone:555-1234
Birthdaybirthdaybirthday:thismonth
Business Addressbusinessaddressbusinessaddress:(street, postal code city)
Business Address Citybusinesscitybusinesscity:redmond
Business Address Streetbusinessstreetbusinessstreet:outlookway
Business home pagebusinesshomepagebusinesshomepage:www.msoutlook.info
(see bug note below)
Business phonebusinessphonebusinessphone:555-4321
Business postal codebusinesspostalcodebusinesspostalcode:98052
Callback phone numbercallbacknumbercallbacknumber:555-6789
Car phonecarphonecarphone:555-9876
Categoriescategorycategory:project
Childrenchildrenchildren:nico
Citycitycity:redmond
Companycompanycompany:Microsoft
Departmentdepartmentdepartment:development
E-mailemailaddressemailaddress:mike@contoso.com
First namefirstname,
contactfirstname
firstname:robert
Full Namefullnamefullname:(Robert Sparnaaij)
Home Addresshomeaddresshomeaddress:(street, postal code city)
Home Address Cityhomecityhomecity:redmond
Home Address Streethomestreethomestreet:outlookway
Home faxhomefaxhomefax:555-2468
Home phonehomephonehomephone:555-13579
Home postal codehomepostalcodehomepostalcode:98052
IM addressimaddressimaddress:luis@live.com
In Folderfolderpathfolderpath:contacts
Job titlejobtitlejobtitle:manager
Last namelastname,
contactlastname
lastname:sparnaaij
Mailing Addressmailingaddressmailingaddress:(street, postal code city)
Manager’s namemanagermanager:fernando
Mobile phonemobilephonemobilephone:555-2424
Modifieddatemodifieddatemodified:10/15/2008
Nicknamenicknamenickname:roady
Notesbody, content, contentscontents:(looking for internship)
Officeofficelocationofficelocation:red/101
Other Addressotheraddressotheraddress:(street, postal code city)
Other Address Cityothercityothercity:redmond
Other Address Streetotherstreetotherstreet:outlookway
Other postal codeotherpostalcodeotherpostalcode:98052
Pagerpagerpager:882-8080
PO Boxpoboxpobox:12345
Primary Phoneprimaryphoneprimaryphone:555-1212
Professionprofessionprofession:accountant
Spousespousespouse:susana
Street Addressstreetstreet:outlookway
Titlepersonaltitlepersonaltitle:manager
Web pagewebpagewebpage:www.howto-outlook.com
ZIP/Postal Codepostalcodepostalcode:98052

Bug note – home page confusion madness:
The businesshomepage search field is wrongly mapped to the “Personal Home Page” field of the contact and thus the same as the webpage search field. However, as the “Personal Home Page” field is the field which is shown on the main contact form (labeled with: Web page address), this probably won’t be a direct issue for most.

The actual “Business Home Page” field is an additional field which can be specified in the All Fields section of a contact and is because of this bug not indexed nor searchable.

Calendar

The following Calendar fields can be searched;

FieldCommandExample
Attachment Containsattachtmentattachment:presentation.ppt
attachment:(presentation content)
Attachmentshasattachmentshasattachments:yes
hasattachments:no
Bodycontentscontents:(agenda project)
Categoriescategorycategory:blue
category:[]
Endendend:10/15/2008
Importanceimportanceimportance:low
importance:normal
importance:high
In Folderfolderpathfolderpath:calendar
Locationlocation
meetinglocations
location:calgary
Meeting Statusmeetingstatusmeetingstatus:accepted
meetingstatus:declined
meetingstatus:notresponded
meetingstatus:tentative
meetingstatus:organized
Modifieddatemodifieddatemodified:10/15/2008
Optional Attendeesoptionalattendeesoptionalattendees:mike
Organizer, Fromorganizer, by, fromorganizer:jonas
Readread, isreadread:yes
read:no
Recurringisrecurring
recurring
isrecurring:true
recurring:true
Required Attendeesrequiredattendeesrequiredattendees:mike
Resourcesresourcesresources:(room 404)
Sensitivitysensitivitysensitivity:normal
sensitivity:personal
sensitivity:private
sensitivity:confidential
Show Time Asshowtimeasshowtimeas:free
showtimesas:tentative
showtimesas:busy
showtimesas:outofoffice
Startstartstart:10/15/2008
Subjectsubjectsubject:(project meeting)

Tasks

The following Task fields can be searched;

FieldCommandExample
Bodycontentscontents:(fill out form)
Categoriescategorycategory:blue
category:[]
Completeiscompletediscompleted:yes
iscompleted:no
Date Completedcompletedcompleted:10/15/2008
Due Dateduedue:10/15/2008
In Folderfolderpathfolderpath:tasks
Modifieddatemodifieddatemodified:10/15/2008
Ownertaskownertaskowner:mike@contoso.com
Priorityprioritypriority:low
priority:normal
priority:high
Reminder Timeremindertimeremindertime:today
Start Datestartstart:10/15/2008
Statustaskstatustaskstatus:notstarted
taskstatus:inprogress
taststatus:completed
taskstatus:waitingonsomeone
taskstatus:deferred
Subjectsubjectsubject:(holiday form)

Notes

The following Note fields can be searched;

FieldCommandExample
Bodycontentscontents:(login password)
Categoriescategorycategory:blue
category:[]
Colorcolorcolor:blue
color:green
color:pink
color:yellow
color:white
Createddatecreateddatecreated:10/15/2008
In Folderfolderpathfolderpath:notes
Modifieddatemodifieddatemodified:10/15/2008
Subjectsubjectsubject:(user credentials)

Journal

The following Journal fields can be searched;

FieldCommandExample
Bodycontentscontents:(work done)
Categoriescategorycategory:blue
category:[]
Companycompanycompany:microsoft
Contactcontactnamescontactnames:mike@contoso.com
Endendend:15/10/2008
Entry Typeentrytypeentrytype:(phone call)
In Folderfolderpathfolderpath:journal
Mileagemileagemileage:64
Modifieddatemodifieddatemodified:15/10/2008
Sensitivitysensitivitysensitivity:normal
sensitivity:personal
sensitivity:private
sensitivity:confidential
Startstartstart:10/15/2008
Subjectsubjectsubject:(called for project update)

Search in attachments

The indexer also indexes any attachment that is included with any Outlook item. This allows you to search within the attachments as well without needing to open them first. There are a couple of commands and tricks to search and work with attachments as optimal as possible;

If you want to search only in items that have an attachment, but not directly want to search within the attachment, you can use;
has:attachment
hasattachment:true

If you want to search in the attachments but not in the item that has the attachment itself you can use;
is:attachment
isattachment:true

If you want to search for an attachment with a specific extension you can use ext or filext;
ext:txt
filext:txt

ext:docx
filext:pdf