Because Slack works quite a bit like a message-based social network or instant messaging system, important information often scrolls off quickly in active channels and conversations.
Finding that information later has a high value, and this short chapter covers some important ground by detailing how to get the most out of Slack’s Search feature. Unlike a typical search engine, Slack provides context around search results, making it easy to see the portion of the discussion in which they occur.
Slack’s powerful search finds matches for you throughout the available message archive, but only within your personal set of searchable content:
Every Slack app has a search option in the messaging view, whether it appears as a full Search field or it’s a Search button you tap (in the mobile apps). You can also use the slash command /s
in the Message field—it’s a valid command, but Slack doesn’t show it as an option. (You can also type /search
.)
Slack lets you type freeform queries. For instance, if you search on apple
, the app sends a query to its central store of your team’s messages and brings up every message and uploaded or directly linked file that contains apple
—but only from those channels and conversations to which you have access.
In Figure 120, I’ve searched on iPhone
in the TidBITS team. The results are sorted into Messages and Files, and show the number of matches in parentheses following each category. Messages includes only regular messages, while Files includes any snippet or post, text in any file that’s been uploaded, and any linked Google Drive, Box, or Dropbox files.
Let’s look at what you can do with the search results in the Messages tab. By default, each result both highlights the matches in the message and shows the preceding and following messages, as well as the channel or conversation name and date.
From the search results list in the desktop and Web apps, you can:
In a mobile client:
In the desktop and Web apps, you can also:
You can enter more specific search terms to refine your search better. This is useful when you’re looking for something particular or when you get too many matches from a general search query—or not enough.
You can start by restricting matches to phrases by putting a set of words in quotation marks, like "iPhone malware"
.
To make a broader match, try wildcard matching by adding an asterisk (*
) at the end of a full or partial word. The stub has to have at least three letters before the asterisk. For instance, if you want to find detail, detailed, details, and detailing, you could search on detail*
.
If you want to further nail down a search, you can limit it to a date range, channel or person, or a message property. All this makes it easier to pinpoint what you’re looking for.
Slack lets you limit results by date with a bunch of different words: before:
and after:
to set limits, on:
or during:
to define an entire period (like a day or month), and explicitly yesterday
and today
, as well as week
, month
, or year
to refer to the most recent week, month, or year. So you can see before:month
(meaning the previous month) or after:yesterday
(if you’re a Paul Giamatti fan).
Precise date formats must be one of MM/DD/YYYY, MM-DD-YYYY, YYYY-MM-DD, or YYYY/MM/DD. The European DD-MM-YYYY isn’t supported.
As an example, you might want to find messages between June 1 and June 30, 2015. You could express this in at least three ways:
before:07/01/2015 after:05/31/2015
after:2015-05-31 before:2015-07-01
during:june
Of course, you can combine any of these with additional search terms, so to find messages in the month of June containing the word iPhone, you’d search on: iPhone during:june
In the desktop and Web apps, as you type a special search term like before
or on
, notice that the term appears in the Modifiers area of the Assisted Search popover. Click the term, and the popover helps you construct your search—exactly what you see depends on the modifier. With a date, Slack provides a calendar, which lets you click a date instead of stressing out about entering dates in the precise form required (Figure 121).
Narrowing a search to a channel or person often provides more useful results. Use in:
followed by a channel name, like in:pets-cats
, or a person’s name, like in:glennf
, which matches within conversations with that person. I’ve found that while you can use from:
and to:
with handles, from:
matches correctly, while to:
does not—it’s a synonym for in:
(Figure 122). A special case to find your messages? Use from:me
.
Combining a channel and a person in one query finds even more precise matches, such as when someone offers a particular insight. For instance, in:random in:michael
lets me see all the bon mots from my colleague Michael Cohen.
To only find messages you’ve starred, use has:star
. You can also restrict messages to those that contain a link (any link) with has:link
, and to specific emoji by using has:
, followed by the Slack emoji name in the usual format with colons on either side, like has::robot_face:
. You can’t use autocomplete in this one case; you’ll have to look up the emoji name in order to enter it.
I might type in:mac-news from:tonya has:link
to get a summary of all links that Tonya has posted in the mac-news channel.