You can enter keywords and search terms in the Terms field to narrow or broaden a search of your organization's Google Workspace data using Google Vault. The search operators you can use vary by service. Vault supports search operators for Gmail, Google Groups, Drive, Chat, and Voice, but doesn't support search operators for Calendar.
Search basics
-
Enter search operators in English, even if people in your organization use other languages to communicate. You can use English search operators to find non-English words and phrases.
-
For most services, Vault assumes there is an
AND
operator between search terms if no Boolean operator is specified. -
Vault ignores punctuation marks and case in keywords and phrases.
-
To exclude results that match the search term, put a hyphen (
-
) orNOT
before the search operator. For example, to exclude messages sent to username1 from the search results, you can enter either‑to:username1
orNOT to:username1
.Note: If your search term starts with hyphen, such as
-1000%
, put the individual term in quotation marks to ensure the hyphen is not interpreted as aNOT
operator. For example,-1000%
(with no search operator) matches anything that doesn't contain1000,
while“-1000%”
matches-1000
and1000
, because with quotation marks the hyphen and % are ignored. -
To search for messages or items by account name, always include a colon (:) with no spaces immediately after the operator. For example, use
to:username1
in Gmail andowner:username2
in Google Drive. -
When you enter multiple values for the same operator, group them together in parentheses. For example, to search 2 recipients of a Gmail message, enter
to:(username1 OR username2)
. -
Boolean operators (
AND
,OR
,NOT
, andAROUND
) must be in all caps, otherwise they're treated as keywords. To ensure your terms are processed correctly, on this page review the term complexity guidelines.
Search operators
Expand section | Collapse all & go to top
Gmail & Google Groups search operatorsAvailable search operators:
- General search operators
- Search by text, subject, or Message-ID
- Search by account
- Search by message label, folder, and type
- Search by date or size
- Search by attachment properties
General search operators
Operator | Description & usage |
---|---|
AND |
Find messages that include 2 given search terms. Examples:
|
OR |
Find messages that include either of 2 given search terms (or both). To ensure your query is processed correctly, use less than 20 Examples:
|
NOT |
Find messages that do not include a given search term. Examples:
|
* |
Find unknown or wildcard terms. The wildcard ( You can append a wildcard ( Note: If your wildcard entry results in a phrase that exceeds 100 words, the search will fail. Make your search more specific. Examples:
|
AROUND number |
Find messages with words near each other. Enter a number to specify how many words apart the words can be. Add quotes to return only messages in which the first word appears before the second word. Usage notes:
Example:
|
Text, subject, or ID
Operator | Description & usage |
---|---|
no operator |
Find messages that contain that word or phrase in the message text or subject. To search for a phrase, put the words in double quotes ( Example:
|
subject: |
Find messages with a given word or phrase in the subject. To search for multiple-word subjects, substitute a hyphen ( Example:
|
rfc822msgid: |
Find messages by Message-ID. Message-ID is a unique identifier for a message that is added by mail servers. Email clients and servers use this identifier to track a message. To get the Message-ID header, open a message in Vault and click original. Example:
|
Account
Operator | Description & usage |
---|---|
to: |
Find messages received by a given account. The account can be a group email address. Vault returns any messages that include the account in the to, cc, or bcc fields. When you search accounts in your organization's domain, you don't need to specify the domain. For example, if your domain is Examples:
|
from: |
Find messages sent by the given account. Note:
Examples:
|
cc: |
Find messages with the given account in the cc field. Example:
|
bcc: |
Find messages with the given account in the bcc field. Example:
|
replyto: |
Find messages with the given account as the intended recipient of any replies. Example:
|
list: |
Find messages sent to or from a group. Example:
|
listid: |
Find a message by the unique identifier of the group the message was sent to. The List-ID is included in the headers of messages sent to or from Google Groups. To find a message's List-ID, open a message thread in Vault, and click Original in the upper-right corner. Example:
|
deliveredto: |
Limit search results to Gmail messages successfully delivered to the given account. Example:
|
Label, folder & type
Operator | Description & usage |
---|---|
label: |
Find or exclude messages with a given Gmail label. This operator isn't supported for messages in Google Groups. If the label includes spaces, substitute a hyphen ( Examples:
Note: If you search for a system-generated label, Vault may return an excessive number of messages. |
in: |
Find messages in a given folder. Examples:
|
is: |
Find messages by type or status. Options: Find Gmail messages by status.
|
Date or size
Operator | Description & usage |
---|---|
|
Find messages by when they were sent or received. Enter dates with the format YYYY-MM-DD. Matches are inclusive of the specified date. For example, Example:
|
|
Find messages older or newer than a given period of time. Supported units of time include Example:
|
size: |
Find messages by size in bytes, including any attachments. You can use Example:
|
|
Find messages smaller or larger than a given size in kilobytes or megabytes, including any attachments. Use Example:
|
Attachment properties
Operator | Description & usage |
---|---|
has:attachment |
Find messages with at least one attachment.
|
filename: |
Find messages that include an attachment with the given file name. The search term is case insensitive and supports partial matches and wildcards. Example:
|
filename_exact: |
Find messages that include attachments with the exact file name. This search term is case sensitive. Example:
|
Available search operators:
- General search operators
- Search by account (owner and sharing)
- Search by item properties
General search operators
Operator | Description & usage |
---|---|
no operator |
For supported file types, find items that contain the given keywords or phrases. To search for a phrase, put the words in double quotes ( Example:
|
AND |
Find items that include 2 given search terms. Examples:
|
OR |
Find items that include either of 2 given search terms (or both). Examples:
|
NOT |
Find items that do not include a given search term. Examples:
|
Account
Note: Enter the account as the complete email address, such as [email protected]
or [email protected]
.
Operator | Description & usage |
---|---|
owner: |
Matches
Doesn't match
Example
|
sharedwith: |
Matches
Doesn't match
Example
|
from: |
Matches
Non-matches
Example
|
to: |
Matches
Non-matches
Example
|
Item properties
Operator | Description & usage |
---|---|
is: |
Find items marked with a star.
|
in: |
Find or exclude items moved to trash.
|
type: |
Find items by type. Example:
Supported item types:
|
|
Find items by when they were edited. Enter dates with the format YYYY-MM-DD. Matches are exclusive of the specified date. For example, Example:
|
title: |
Find items by title. Example:
|
Available search operators:
- General search operators
- Search by account
- Search by date
- Search by message and Chat space properties (such as direct message (DM) or message in a space, threaded or unthreaded space, or included content, such as video or file links)
Note: Chat doesn't support Boolean operators or terms that are enclosed in quotes.
General search operators
Operator | Description & usage |
---|---|
+ |
Find messages that contain one or more keywords. Search matches each keyword exactly, such that a search for Example:
|
- |
Exclude messages that contain one or more keywords. Search matches each keyword exactly, such that a search for Example:
|
Account
Operator | Description & usage |
---|---|
from: |
Find direct messages sent by a user and conversations the user participated in. This operator requires the full account name, including your organization's domain. Example:
|
at: |
Find conversations that mention a given user. This operator requires the full account name, including your organization's domain. Example: |
Date
Operator | Description & usage |
---|---|
|
Find messages based on when they were sent or updated. Enter dates with the format YYYY/MM/DD. Search uses UTC by default. Use the Matches are inclusive of the specified date. For example, Examples:
|
|
Find messages older or newer than a given period of time. Supported units of time include Search uses UTC by default. Use the Example:
|
tz: |
Specify a time zone for date- and time-based searches. Specify the time zone with Example:
|
Message & Chat space properties
Operator | Description and usage |
---|---|
has: |
Find messages that include a specific type of content. Example:
Supported content types:
|
is: |
Search for only DMs or only messages in spaces. You can also search for messages in a specific type of space. Options:
|
Available search operators:
General search operators
Operator | Description & usage |
---|---|
message: |
Find text messages that include a keyword. If you enter a word with no search operator, Vault assumes Examples:
|
AND |
Find text messages, voicemails, and call logs that match two search terms. If you enter multiple search terms, Vault assumes Examples:
|
OR |
Find text messages, voicemails, and call logs that match either of 2 search terms. Examples:
|
NOT |
Find text messages, voicemails, and call logs that do not include a search term. Examples:
|
Phone number or date
Operator | Description & usage |
---|---|
with: |
Find text messages and call log events that involve a phone number, and voicemails from a phone number. When you search by phone number, your entry must include:
Example:
|
before: |
Find text messages, voicemails and their transcripts, and call log events that occurred before or after a date. Search is relative to 11:59 PM UTC-7 on the day the text message was sent, the voicemail was created, or the call was made or received. Matches are exclusive of the specified date. For example, Examples:
|
Data type or attachment
Operator | Description & usage |
---|---|
is: |
Find a specific type of data from Google Voice. You can search for the following types:
Examples:
|
has:attachment |
Find text messages that have an attachment. Examples:
|
Troubleshoot query issues
Expand section | Collapse all & go to top
Check for syntax errorsIf your search terms return an error or don’t work as expected, the most common reason is a syntax error. Occasionally, a query might be too complex for the service to process. Here are some common errors:
- Missing operator value, such as
to:
instead ofto:username1
- Missing parentheses, such as
from:(username1 OR username2
from:(username1 OR username2)
- Missing quotes (Gmail and Drive), such as
Solarmora, Inc.
(treated as 2 keywords) instead of"Solarmora, Inc."
(treated as 1 keyphrase) - Wildcard (
*
) in a query for a service other than Gmail. Only Gmail supports wildcards.
To ensure your terms are correctly processed, they should meet the following guidelines:
- Use less than 20
OR
terms. If your query includes a date operator (such assent_before:
), use less than 10OR
terms. - Use no more than 2
AROUND
operators in a query. - Set the
AROUND
distance to less than 20. - Consider splitting long queries into smaller equivalent queries. For example,
(tax AND audit) OR (secret AND project)
can be run as 2 separate queries:(tax AND audit)
(secret AND project)
Some browser extensions can cause unexpected query results. To isolate any issues, try turning off your browser extensions one by one. Run the query after each deactivation to see if it affects your results.