You would have explored the features of GMail Search in my previous post Hack GMail - Part 1
In my previous post of hacking the search, you would have explored the features on Labels, filters etc. On continuing the exploration, I came with my second post. This post lists down the features which are not available in the simple search facility. Come one, lets explore the the advanced search features.
For typing the query, you need not open the simple search view, just directly type the query in the default query box.
In order to be a master in searching, you have to know the operators used for searching. To know brief about the operators have a visit to
Also have a look on how to create filters and labels. This is a must use tool in Gmail, who fail to use these features, so pity on them. Please don’t miss it out.
In the rest of this blog, you could find the functions of the operators in elaborate.
from: used to specify the sender and fetches all the mails from the same
It is the same as the from in the simple search.
Example 1: Extract all the mails from friends, say abc,abc1,abc2. Then your query goes like this.
from: firstname.lastname@example.org OR email@example.com OR firstname.lastname@example.org
Example 2: Extract all the mails from friends, say abc,abc1 and not from abc2. Then your query goes like this.
from: email@example.com OR firstname.lastname@example.org -email@example.com
Example 3: Extract all the mails from except from abc
Example 3: Extract all the mails from except from yahoo or gmail
from: -yahoo.com –gmail.com
used to specify the recipient and fetches all the mails from the same. It is the same to the </strong>TO in the simple search.
Example 4: Extract all the mails sent to friends, say abc,abc1,abc2. Then your query goes like this.
to: firstname.lastname@example.org OR email@example.com OR firstname.lastname@example.org
Example 5: Extract all the mails sent to groups i.e mails your received from groups.
Example 6: Similarly exclude the mails from yahoogroups
subject: Search for the subject words
Example 7: Search for a single word
Example 8: Search for more than one word. In this example to include all mails with subject Chennai and Mumbai and reject mails with subject kolkatta
Subject: ( Chennai OR Mumbai ) subject: –kolkatta
cc and bcc: This operator function similar to the to: and from: operator. It is used to give the email address or just the account name or just the service provider address to fetch the mails.
Example 9: Fetch all the mails which you had CCed or BCCed
label: Search the mails which holds a label.
Example 10: Let me assume that you have labels and have applied to some mails. Let me say you have label called “Family” for the mails which you receive from your family members. Now you are to search for the mails where only your mom had sent. Here I am considering that both dad and mom uses the same mail id.
label:family from:email@example.com mom OR dad
Example 11: Another example to show is from my inbox. I have grouped all the fun related mails from various groups such as Nidokidos, myWorldPals etc. under the label named “Others”. Now all the mails arriving from that group would be fixed with the label “Others”. Now I need to search the mails from this label, which has photos regarding “Katrina”.
label:Others (subject:nidokidos OR myworldpals)
Another example which rejects all mails with subject beautifulIndia.
Note: If you have label names separated with spaces, then use hyphen(-) while using in searches. The Hyphen, i.e the negation operator is different from this hyphen used in the label names.
E.g.: If you have a label called “Fun Mails”, then while searching use as label:Fun-Mails. Here note that there is no space in between Fun & Mails. If you introduce a space, then the query will search for the mails with label Fun and rejects all mails with words Mails.
i.e. label:Fun –Mails
It is possible to apply one or more label name to a single mail. Example, if you have received a mail from your friend relating to a job matter, then you would apply labels both Friend and Jobs. In such cases, most of the mails may posses more than one label. Now in such cases to search mails pertaining to particular label and rejecting the mails the label you are not in need. The simple figments is to use Negate Operator i.e Hypen.
Example 12: You need to extract all mails from your friend which don’t have job information i.e don’t have label named JOBS.
Example 13: Search all the mails from your friend with attachment, which has only Word document or PDF files as the attachments.
label:Friend has:attachment filename:(pdf OR doc)
in: used to search mail in the specific location i.e Inbox, Archives, Trash, Sent Items etc. If you are in need to search locations except Inbox, you could use this operator.
This operator had really helped me to search in my case, as I had about 30,000+ mails in my trash.
Example 14: Searching your trash box for a which you have deleted it unknowingly. All mails from your friend that had moved to trash.
Now you can combine all the above said operators to search the mail.
Example 15: Search your trash and archives which you are not confident about it’s location which has an attachment of pdf file from your company.
in:anywhere has:attachment filename:pdf
is: Is operator is helps you to fetch mails that have read, unread , starred etc.
Example 16: To fetch all mails that you haven’t read that your friend had sent.
Try with is:read is:unread, yeah you can guess what would be the result.
is:read – gives all the mails that have read is:unread – gives all the mails that haven’t read is:starred – gives all the mails that have been starred in spite you read or not.
after:, before: These operators are date operators which are used to input the query based on date values. The date format which I have aforesaid in the first part as YYYY/MM/DD is used.
Example 17: To search all the mails which have arrived after June 4th 2005. to till date.
Example 18: To search all the mails arrived on particular date, use both the operators
If you use after:2005/09/10 before:2005/09/10, will gives you all the mails.