# Search {#search}

## On Web

TMail offers you several tools to quickly find your emails.

### Quick search

The top search bar allows you to quickly look for your emails. Just start typing text in it, and top search results will appear interactively.

![Group 202](https://github.com/user-attachments/assets/9cda735f-9533-4513-853d-b45b08540e82)

Additional filters are also added for convenience. Those include:

 - (1) `Has attachment`: If checked, then only emails with attachments will be returned.
 - (2) `Last 7 days`: If checked, then only returns emails sent within the last 7 days.
 - (3) `From me`: Only includes emails that you sent.

(4) allows to clear your input.

(5) allows to enter the advanced search.


### Advanced search

The top search bar button on the left opens the advanced search, allowing you to specify more criteria.

![Group 214](https://github.com/user-attachments/assets/c54c2780-dd2b-479b-bb71-a782401d9634)

Those criteria includes:

 - (1) `From`: Specifying who should have sent the emails returned. This field supports auto-complete on your contacts.
 - (2) `To`: Specifying who the emails returned should be addressed to. This field supports auto-complete on your contacts.
 - (3) `Subject`: Allow specifying words that should appear in the subject of returned emails.
 - (4) `Has the word`: Specifies the word that should appear anywhere in the returned email.
 - (5) `Doesn't have`: Specifies the word that should not appear anywhere in the returned email.
 - (6) `Folder`: Specifies in which folder the returned emails should be placed.
 - (7) `Date`: Specifies a time range in which the returned emails should have been sent.
 - (8) `Sort by`: Specifies the criteria to display the result order: most recent, oldest, relevance, sender name, subject 
 - (9) `Has attachment`: If checked, then only emails with attachments will be returned.

Clicking the (11) search button will launch the search and display all corresponding emails. `Clear filer` (10) will reset your input.

By default, the search result is sorted by the criteria "Most recent". You can click on sort icon to select another sort criteria from the list: Oldest, Relevance, Sender name, Subject, Size 

![Group 12](https://github.com/user-attachments/assets/52fd5008-a2c7-4065-a8d8-89df69251a8a)


### Folder filters

![Group 35 (2)](https://github.com/user-attachments/assets/318ae15f-a9ac-447d-b0f2-26d5d5748946)

From the folder display you can easily apply filters to the current folder.

Filters includes:

 - (1) All emails in this folder with attachments
 - (2) All emails in this folder that are not read
 - (3) All emails in this folder that are starred


## On Mobile

On mobile, When you click on Search bar, start typing text in it, and top search results will appear interactively.

 Under the search bar, there are some tags that allow you to specify more criteria. Those criteria include:

 - (1) `From`: Specifying who should have sent the emails returned. When you click on this tags, a new screen will be opened that allow you to input email address. The system supports auto-complete on your contacts
 - (2) `To`: Specifying who the emails returned should be addressed to. When you click on this tags, a new screen will be opened that allow you to input email address. The system supports auto-complete on your contacts
 - (3) `Has attachment`: If checked, then only emails with attachments will be returned.
 - (4) `All time`: This field specifies the time range in which the returned emails should have been sent. Default option is "All time". When I click on this field, a new screen will be opened.
 - (5) `Folder`: Specifies in which folder the returned emails should be placed. Default option is "All folders". When I click on this field, a new screen will be opened.
 - (6) `Sort by':  Specifies the criteria to display the result order

![Frame 162](https://github.com/linagora/tmail-flutter/assets/68209176/af0a4d8d-2272-4e49-901a-18e40f9ebc5d)

![Frame 22 (1)](https://github.com/user-attachments/assets/eba5f489-57f9-4491-9d7a-eee7c25cba1f)

### Folder Filter 
On mobile when you click filter icon, you can select the filter criteria to apply:

![Frame 21 (4)](https://github.com/user-attachments/assets/4eec908e-b0ec-42d3-a793-e86b36a31847)


