Advanced Keyword Searches

Applies to: Office 365 for enterprises, Live@edu

When people search for keywords, they usually just type the words and separate the words with spaces. This produces the same results as separating the words with the AND operator. The search finds e-mail messages that contain all the keywords.

However, to create more advanced keyword searches, you can use the following search techniques:

  • Exact phrases
  • Parentheses
  • Wildcard searches
  • Boolean operators
  • Advanced Query Syntax

Note   Keyword searches are not case-sensitive. For example, cat and CAT return the same results. However, the Boolean operators AND, OR, and NOT must be uppercase.

Exact phrases

Use double quotation marks ( " ) to search for exact terms or phrases. For example, "cat and dog" finds messages that contain the exact phrase cat and dog. The search cat AND dog finds messages that contain both words somewhere in the message. Exact phrases can help you obtain more precise results.

Parentheses

Instead of using double quotation marks to represent exact phrases, you can use parentheses to group and search for multiple keywords. For example, (cat dog) finds messages that contain the words cat and dog in any order.

Wildcard searches

Prefix wildcard searches are supported. In a prefix search, put an asterisk after the word. For example, cat* finds any message that contains cat, catalog, category, catalytic,catamaran, and so on.

Suffix searches (*cat) or substring searches (*cat*) are not supported.

Return to top

Boolean operators

The Boolean operators AND, OR, and NOT help you define more precise mailbox searches by including or excluding specific words in the search query. Use the following Boolean operators to narrow or broaden search results:

  • AND   Connecting keywords with AND means that all the words are present in each message. For example, cat AND dog finds messages that contain both cat and dog. The AND operator narrows the scope of a search because it requires two or more words to be present. This can result in fewer messages found.
  • OR   Connecting keywords with OR means that a message is found if any of the keywords are present in a message. For example, catORdog finds any messages that contain either cat or dog. The OR operator expands the scope of a search because it requires that a message contain only one of the keywords. This can result in more messages found.
  • NOT   Including NOT in a keyword search string requires that the first word or phrase is present, but excludes messages that also contain the second word or phrase. For example, catANDdogNOTbird finds messages that contain both cat and dog only if they do not contain bird. This lets you narrow a search by eliminating irrelevant messages.

You can also combine Boolean phrases. For example, dog AND NOT (cat OR bird) finds any message that contains dog only if it doesn't contain cat or bird.

Return to top

Advanced Query Syntax

Advanced Query Syntax (AQS) helps you produce more precise search results by using targeted queries that search specific properties in a message type. For example, in a search of e-mail messages, you can search for a keyword in the subject line of an e-mail message, and search for a different keyword in the message body. For example, the following search finds only the messages that contain the word pets in the message body and either the word dog or cat in the subject line: pets AND subject:(dog cat).

Other properties that you can search for in e-mail messages include the date that a message was sent or received, the inclusion of an attachment on a message, or messages sent to or from specific people. You can also search for properties in other message types such as contacts, meetings, and tasks.

Note   You can also specify message types to search by clicking Select message types. In the Messages Types to Search dialog box, select which message types to search, and in the Keywords field, use an AQS query to define the properties and values to search.

Creating AQS queries

When you use AQS, specify the name of the property and a keyword or value as in the following examples:

  • subject:reorganization
  • sent:4/15/09
  • attachment:budget.xlsx

You can also use Boolean operators, exact phrases, parentheses, or wildcard searches in the AQS query to narrow or broaden the scope of the search as in the following examples:

  • from:steve AND sent:4/15/2009
  • sent:4/15/09 AND "FY09 budget"
  • subject:(company reorganization)
  • attachment:budget*

E-mail message properties

The following table lists common e-mail message properties that you can include in an AQS query.

Property Example Search results

Attachments

attachment:annualreport.ppt

Messages that have an attachment that is named annualreport.ppt. The use of attachment:annualreport or attachment:annual* returns the same results as using the full name of the attachment.

Cc

cc:paul singh

cc:pauls

cc:pauls@contoso.edu

Messages with Paul Singh in the Cc field

From

from:max stevens

from:maxs

from:maxs@contoso.edu

Messages sent by Max Stevens

Sent

sent:4/15/2009

Messages that were sent on April 15, 2009

Subject

subject:"Quarterly Financials"

Messages that contain the exact phrase "Quarterly Financials" in the subject line

To

to:judy lew

to:judyl

to:judyl@contoso.edu

Messages sent to Judy Lew

Learn more

For more information about how to use AQS, see Advanced Query Syntax.

Also, see Multi-Mailbox Searches.

Return to top