Gmail's Excellent Feature 'Search'
One of Gmail's excellent features is its Search function. Searching can be as simple as entering a keyword or two into the Search field at the top of any page to very complex using Gmail's advanced "Query Words" to better constrain searches. Read more to better understand how "Query Words" can help you with your advanced message searching...

Clicking the "Show Search Options" link will open up a pane containing several entry fields and dropdowns. This lets you easily specify more detailed search criteria. For example, say you want to search for all email that is unread, regardless of under what Label it is filed. Simply click the "Search:" dropdown, select "Unread Mail" and click the "Search Mail" button. Gmail will display a list of all unread mesasges. Likewise, you can select specific Labels and you can enter specific terms. It's very powerful and useful.







But as more savvy users, we often crave, as Tim The Toolman Taylor says, "More power!" Gmail also provides users the ability to prefix their search keywords with "query words" that instruct Gmail how to search. And there is no need to open the Search Options--these can be entered in the simple search window at the top of any page.

For example, say you want to search for all messages Labeled with the "Family" Label. You could open the "Show Search Options" pane, select the "Family" Label from the dropdown, and click "Search Mail". Or, you could just enter into the search box at the top of any page "label:family" and hit Enter! Both do the same thing, just in different ways.

But this type of searching goes way beyond this by letting you search using more complex criteria. For example, building on our example above, say you want to search for messages containing attachments from your family sent before May 21, 2004? You would simply enter the following advanced search criteria:

label:family has:attachment before:2004/5/21

Yes, this could actually be done in the Search Options pane, but in addition to the available search criteria fields, query words not only let you search using criteria not included in the Search Options pane, (like "cc:" and "bcc:") but you can do "compound" searches otherwise not available in the Search Options pane. For example:

label:doctors label:statements has:attachment before:2004/5/21 in:anywhere

would return all messages with both Labels of "Doctors" and "Statements" containing attachments, sent before May 21, 2004, existing anywhere in my account including the Trash and Spam views.

It's pretty powerful, and fairly intuitive once you get the hang of it.

For more information, you should check the direct link to Gmail's "How do I use advanced search?" help page found [here] (You may need to be logged into your Gmail account to access this page.)

Here is table of "query words" from that page:


Operator
from:

to:

subject:

OR

-
(hyphen)
label:

has:attachment

filename:




" "
(quotes)



( )




in:anywhere


in:inbox
in:trash
in:spam
is:starred
is:unread
is:read
cc:
bcc:
after:
before:


Definition
Used to specify the sender

Used to specify a recipient

Search for words in the subject line

Search for messages matching term A or term B*
*OR must be in all caps
Used to exclude messages from your search

Search for messages by label*
*There isn't a search operator for unlabeled messages
Search for messages with an attachment

Search for an attachment by name or type




Used to search for an exact phrase*
*Capitalization isn't taken into consideration



Used to group words
Used specify terms that shouldn't be excluded



Search for messages anywhere in your account*
*Messages in 'Spam' and 'Trash' are excluded from
searches by default
Search for messages in 'Inbox', 'Trash', or 'Spam'


Search for messages that are starred, unread or read


Used to specify recipients in the 'cc' or 'bcc' fields

Search for messages after or before a certain date*
*Date must be in yyyy/mm/dd format.


Example(s)
Example - from:amy
Meaning - Messages from Amy
Example - to:david
Meaning - All messages that were sent to David (by you or someone else)
Example - subject:dinner
Meaning - Messages that have the word "dinner" in the subject
Example - from:amy OR from:david
Meaning - Messages from Amy or from David
Example - dinner -movie
Meaning - Messages that contain the word "dinner" but do not contain the word "movie"
Example - from:amy label:friends
Meaning - Messages from Amy that have the label "friends"
Example - from:david has:attachment
Meaning - Messages from David that have an attachment
Example - filename:physicshomework.txt
Meaning - Messages with an attachment named "physicshomework.txt"

Example - label:work filename:pdf
Meaning - Messages labeled "work" that also have a PDF file as an attachment
Example - "i'm feeling lucky"
Meaning - Messages containing the phrase "i'm feeling lucky" or "I'm feeling lucky"

Example - subject:"dinner and a movie"
Meaning - Messages containing the phrase "dinner and a movie" in the subject
Example - from:amy (dinner OR movie)
Meaning - Messages from Amy that contain either the word "dinner" or the word "movie"

Example - subject:(dinner movie)
Meaning - Messages in which the subject contains both the word "dinner" and the word "movie"
Example - in:anywhere subject:movie
Meaning - Messages in 'All Mail', 'Spam', and 'Trash' that contain the word "movie"

Example - in:trash from:amy
Meaning - Messages from Amy that are in the trash

Example - is:read is:starred from:David
Meaning - Message from David that have been read and are marked with a star

Example - cc:david
Meaning - Messages that were cc-ed to David
Example - after:2004/4/17 before:2004/4/18
Meaning - Messages sent on April 17, 2004.*
*More precisely: Messages sent on or after April 17, 2004, but before April 18, 2004.




Email