# Extended quick search key with search expressions

**URL:** <https://forum.mattermost.com/t/extended-quick-search-key-with-search-expressions/708>\
**Category:** Feedback\
**Created:** [January 3, 2016, 1:11am UTC](https://forum.mattermost.com/t/extended-quick-search-key-with-search-expressions/708 "2016-01-03T01:11:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mariocup](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@mariocup](https://forum.mattermost.com/u/mariocup)\
**Post date:** [January 3, 2016, 1:11am UTC](https://forum.mattermost.com/t/extended-quick-search-key-with-search-expressions/708/1 "2016-01-03T01:11:25Z")

</div>

Finding the right content in a chat history can be quite time consuming and therefore I am looking for a functionality similar to Expression Search in Thunderbird Plugin.

# Use-case:

I want to search for an email/chat with an attachment e.g. from mike which was sent in the last 30 days. I can imagine a similar scenario for a chat correspondence.

# Syntax:

days:(0 -30) f:mike a:yes or …

I think that the following commands can help to improve the search functionality a lot and to save time.

_from:mike or f:mike_  
This expression searches all messages from ‘mike’.

_to:bill or t:bill_  
This expression searches all messages to ‘bill’.

_attachment:yes or a:yes_  
This expression searches all messages for an attachment

_filename:foo.doc or fi:image or fn:msword or file:html_  
This expression searches all messages for an attachment name or type.

_is:replied or i:UnRead_  
This expression searches all messages for status, The status can be one of Replied, Read, Marked, UnRead, New or Attachment.

_ag:3 or da:3 or age:3 or older\_than:3 or days:(3 -5) or age:today or newer\_than:8week_  
This expression searches all messages to match age in days. days:(3 -5) will search for messages that age between 3 to 5 days.

_body:electric bill_  
This expression searches all messages for ‘electric bill’ in the body of the message.

_label:Important or tag:TODO or l:NA_  
could be used for hashtags

_before:2011/03/09 07:12:00 or be:09 Mar 2011 05:00:00 or after:Mar 10, 2011 or af:(2011/03/01 -2011/03/09)_  
This expression searches all messages within the date range.

_date:2011/01 or date:2011/01/03 or d:" 03:"_  
This expression searches all messages to match date. The internal format for compare is “yyyy/mm/dd hh:mm:ss”, locale date is also supported.

---

<div class="post-metadata">

**Author:** ![heinrich](https://avatars.discourse-cdn.com/v4/letter/h/e47c2d/32.png) [@heinrich](https://forum.mattermost.com/u/heinrich)\
**Post date:** [February 28, 2016, 10:51pm UTC](https://forum.mattermost.com/t/extended-quick-search-key-with-search-expressions/708/2 "2016-02-28T22:51:01Z")

</div>

+1  
Searching by date and date range is an essential feature to me!

---

<div class="post-metadata">

**Author:** ![icb410](https://avatars.discourse-cdn.com/v4/letter/i/b5e925/32.png) [@icb410](https://forum.mattermost.com/u/icb410)\
**Post date:** [July 20, 2017, 1:04pm UTC](https://forum.mattermost.com/t/extended-quick-search-key-with-search-expressions/708/3 "2017-07-20T13:04:13Z")

</div>

++1 Just as important is ability to filter OUT messages (e.g. from a bot) can we have a ‘NOT’ feature for any of these search expressions?

---

<div class="post-metadata">

**Author:** ![lindy65](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/lindy65/32/1811_2.png) [@lindy65](https://forum.mattermost.com/u/lindy65)\
**Post date:** [July 24, 2017, 8:34am UTC](https://forum.mattermost.com/t/extended-quick-search-key-with-search-expressions/708/4 "2017-07-24T08:34:34Z")

</div>

Thanks for your feedback and feature idea,

We are working on improving search and hope to include some of these changes in an upcoming release.

I’m not sure that all your use cases will be covered so perhaps you’d like to open a feature idea on the [forum](https://mattermost.uservoice.com/forums/306457-general) or add your vote to the various “search” improvements that already exist?
