How to use the query language
If the advanced form is not enough to configure complex search conditions, use the query language. This enables you to:
- Only search in specific message fields. For example, a search for messages from “Alice” with the “Report” attachment:
from:Alice attachment:Report
- Search for messages within a specific date range. For example, a search for messages from 15.06.16 to 10.07.2016:
date-begin:2016-06-15 date-end:2016-07-10
- Search for messages in specific folders or with specific tags. For example, a search in the “From Fluffy” folder:
folder:"Messages from Fluffy"
- Use operators to combine search conditions. For example, to look for messages from Mad Hatter to Alice and messages to Alice containing the word “tea” at the same time, use this formula:
(from:(just.mad.hatter OR Mad Hatter) OR text:tea) AND to:Alice
Message fields
Yandex.Mail usually searches in all message fields and in the currently open folder. You can refine the search and specify the message field to search in. This will make it possible to search separately in the message text, in senders and recipients, and in attachments, as well as to search messages by date, labels, and folders.
Type several comma-separated fields without spaces to search for the same word in multiple fields. For example: from,cc,bcc:Mad Hatter
.
Senders and recipients fields
Field | Description | Syntax | Query example |
---|---|---|---|
| Search for messages with the sender specified. You can search by sender name (“Alice”), login (“alice.the.girl”), and domain (“yandex.com”) | |
The system will search for messages that contain "cheshire.katze" in the From field. |
| Search for messages with the recipient specified. You can search by sender name (“Alice”), login (“alice.the.girl”), and domain (“yandex.com”) | |
The system will search for messages that contain "Alice" in the To field. |
| Search by Cc . You can search by sender name (“Alice”), login (“alice.the.girl”), and domain (“yandex.com”) | |
The system will search for messages that contain "just.mad.hatter" in the Cc field. |
| Search by Bcc. You can search by sender name (“Alice”), login (“alice.the.girl”), and domain (“yandex.com”) | |
The system will search for messages that contain "Rabbit" in the Bcc field. |
Field | Description | Syntax | Query example |
---|---|---|---|
| Search for messages with the sender specified. You can search by sender name (“Alice”), login (“alice.the.girl”), and domain (“yandex.com”) | |
The system will search for messages that contain "cheshire.katze" in the From field. |
| Search for messages with the recipient specified. You can search by sender name (“Alice”), login (“alice.the.girl”), and domain (“yandex.com”) | |
The system will search for messages that contain "Alice" in the To field. |
| Search by Cc . You can search by sender name (“Alice”), login (“alice.the.girl”), and domain (“yandex.com”) | |
The system will search for messages that contain "just.mad.hatter" in the Cc field. |
| Search by Bcc. You can search by sender name (“Alice”), login (“alice.the.girl”), and domain (“yandex.com”) | |
The system will search for messages that contain "Rabbit" in the Bcc field. |
Text fields
Field | Description | Syntax | Query example |
---|---|---|---|
| Search for messages with the subject specified. If a subject contains several words, it should be specified in quotes, or a back slash | |
The system will search for messages that contain "miracle tea" in the Subject field. Note. If a subject consists of multiple words, use the quote operator ". |
| Search in the message body. | |
The system will search for messages with a body that contains "Masala tea from India". |
Field | Description | Syntax | Query example |
---|---|---|---|
| Search for messages with the subject specified. If a subject contains several words, it should be specified in quotes, or a back slash | |
The system will search for messages that contain "miracle tea" in the Subject field. Note. If a subject consists of multiple words, use the quote operator ". |
| Search in the message body. | |
The system will search for messages with a body that contains "Masala tea from India". |
Attachment fields
Field | Description | Syntax | Query example |
---|---|---|---|
| Search for messages with or without attachments. To search for messages with attachments, enter “yes” after the operator (without a space); to search for messages without attachments enter “no” (). | |
The system will search for messages with attachments. |
| Search by attachment name. | |
The system will search for messages with attachments that contain “photo” in the title. |
Field | Description | Syntax | Query example |
---|---|---|---|
| Search for messages with or without attachments. To search for messages with attachments, enter “yes” after the operator (without a space); to search for messages without attachments enter “no” (). | |
The system will search for messages with attachments. |
| Search by attachment name. | |
The system will search for messages with attachments that contain “photo” in the title. |
Date fields
Field | Description | Syntax | Query example |
---|---|---|---|
| Search for email for the specified month. | | month:april The system will search for messages from April of this year. If April still has not come this year, the system will search for messages from last April. |
| Search for email for the specified year. | | year:2016 The system searches for email from 2016. |
and
| Search for messages in the specified date range. The date range is specified inclusively. You can use these operators separately: | |
The system will search for messages from 15.06.16 until the current date inclusive.
The system will search for messages from 15.06.16 to 10.07.2016 inclusive. |
| Search for messages until the specified date exclusive. | |
The system will search for messages from the mailbox creation date through14.06.16. |
and
| Search for messages in the specified date range in relation to the current date. The value may be specified in hours (“h”), days (“d”) or weeks (“w”). | |
The system will search for messages older than two days.
The system will search for messages older than two days but newer than one week. |
Field | Description | Syntax | Query example |
---|---|---|---|
| Search for email for the specified month. | | month:april The system will search for messages from April of this year. If April still has not come this year, the system will search for messages from last April. |
| Search for email for the specified year. | | year:2016 The system searches for email from 2016. |
and
| Search for messages in the specified date range. The date range is specified inclusively. You can use these operators separately: | |
The system will search for messages from 15.06.16 until the current date inclusive.
The system will search for messages from 15.06.16 to 10.07.2016 inclusive. |
| Search for messages until the specified date exclusive. | |
The system will search for messages from the mailbox creation date through14.06.16. |
and
| Search for messages in the specified date range in relation to the current date. The value may be specified in hours (“h”), days (“d”) or weeks (“w”). | |
The system will search for messages older than two days.
The system will search for messages older than two days but newer than one week. |
Folder and label fields
Field | Description | Syntax | Query example |
---|---|---|---|
| Search for messages in the specified folder. If a folder name consists of several words, it should be specified in quotes, or a back slash | |
The system will search for messages in the “Messages from Fluffy” folder. |
| Search for the messages with a specified label. If a label name consists of several words, it should be specified in quotes, or a back slash To search for unread messages, specify the “unread” label, or the “read” label to search for read messages. | |
The system will look for messages that contain the “Chinese tea” label. |
Field | Description | Syntax | Query example |
---|---|---|---|
| Search for messages in the specified folder. If a folder name consists of several words, it should be specified in quotes, or a back slash | |
The system will search for messages in the “Messages from Fluffy” folder. |
| Search for the messages with a specified label. If a label name consists of several words, it should be specified in quotes, or a back slash To search for unread messages, specify the “unread” label, or the “read” label to search for read messages. | |
The system will look for messages that contain the “Chinese tea” label. |
Operators
You can use operators to combine conditions in a query, specify search options, and search for messages with an exact quote.
You can use multiple space separated operators in one query. For instance, "Masala from India" subject:tea from:rabbit.
Operator | Description | Syntax | Query example |
---|---|---|---|
| Search for messages that contain the exact phrase (search by quote). | |
The system will search for messages that contain “ten impossible things before breakfast”. |
| Search for messages that do not contain the specified word. Only the word preceded by the operator is excluded. You can use multiple | |
The system will search for messages that contain “tea”, but do not contain “pu-erh”.
The system will search for messages with a Subject that contains “tea”, but does not contain “pu-erh”. |
| Search for messages that contain any word from the query. You can use multiple | |
The system will search for messages that contain at least one word from the query: “black”, “green”, or “herbal”. |
| Search for messages that contain all the words from the query. You can use multiple | |
The system will only search for messages that contain all the words from the query: “white”, “Chinese”, and “tea”. |
| Grouping words in complex queries. Any operators can be used inside a group included in brackets. | Whether |
The system will search for messages received before October 11, 2016, that contain just.mad.hatter or “Mad Hatter” in the “From” field, and “tea ceremony” in the body text. |
Operator | Description | Syntax | Query example |
---|---|---|---|
| Search for messages that contain the exact phrase (search by quote). | |
The system will search for messages that contain “ten impossible things before breakfast”. |
| Search for messages that do not contain the specified word. Only the word preceded by the operator is excluded. You can use multiple | |
The system will search for messages that contain “tea”, but do not contain “pu-erh”.
The system will search for messages with a Subject that contains “tea”, but does not contain “pu-erh”. |
| Search for messages that contain any word from the query. You can use multiple | |
The system will search for messages that contain at least one word from the query: “black”, “green”, or “herbal”. |
| Search for messages that contain all the words from the query. You can use multiple | |
The system will only search for messages that contain all the words from the query: “white”, “Chinese”, and “tea”. |
| Grouping words in complex queries. Any operators can be used inside a group included in brackets. | Whether |
The system will search for messages received before October 11, 2016, that contain just.mad.hatter or “Mad Hatter” in the “From” field, and “tea ceremony” in the body text. |