Search Effectively

Because Slack works quite a bit like a message-based social network or instant messaging system, important information often scrolls off the top of the screen quickly in active 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.

Compose Queries

Every Slack app has a search option in the messaging view, whether it appears as a full Search field or 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 workspace’s messages and brings up every message and uploaded or directly linked file that contains apple—but only from conversations to which you have access, which can include all public channels.

You can enter more specific search terms to refine your search. 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 word 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*.

Examine Results

In Figure 94, I’ve searched on iphone in the TidBITS workspace using a desktop app, but the result will be the same in mobile, too. The results are sorted into Messages and Files, and show the number of matches in parentheses following each category. (On the right is a “Filter by” section that I’ll get into later.)

Figure 94: Desktop and web search results show matches with keywords highlighted as well as a filter pane for refining.
Figure 94: Desktop and web search results show matches with keywords highlighted as well as a filter pane for refining.

Use the headings at the top of the search results to filter by Messages or Files. Messages includes only regular messages, while Files includes any snippet or post, text in any file that’s been uploaded, and any linked files from cloud services, like Dropbox and Google Drive, and other apps.

The message results are grouped either by “Most recent” or “Most relevant” in desktop and web apps, which you can toggle between, or with the most recent first in mobile apps. Each entry shows the conversation name and date above the message, followed by the message as it appears in a conversation. In mobile apps, conversations are loosely grouped under dates.

From the search results list in the desktop and web apps, you can:

  • View in channel: Click anywhere on a result to view it in context. If the item is part of a thread, the thread sidebar opens at right and highlights where the search term appears in the thread sequence. If it’s a message in the main timeline of a conversation, the main messaging view opens to that point in the discussion and highlights the message. (Yes, the label is always “View in channel,” even when it’s a one-on-one DM or a group DM.)

  • Copy link: When you hover over a message, the Link icon appears. Click it to copy the Slack link to that message.

In a mobile client, you only see the message in context, with a convenient gray label at the bottom that reads “From a thread” if that messages is part of a thread. Tap a threaded message and the thread opens. Tap a message that’s in a main conversation timeline, and a contextual view opens highlighting that message at that point in the conversation’s history.

Both mobile apps show the conversation name at top. Tap a link at the bottom (“Go to #conversation” in Android or “Jump to recent messages” in iOS), and Slack takes you to the most recent point in that conversation.

Filter Searches

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.

In desktop and web apps, a “Filter by” section appears to the right of search results that lets you apply items and select a limited number of elements.

However, you also can type search limiters directly in the Search field, which is the only way to add these in mobile apps (except for some prefab items that appear in a “Search modifiers” list).

Enter these words in a desktop or web app, and Slack offers autocomplete suggestions. (These would be handy in mobile, but aren’t available.)

Search by Date

Slack lets you limit results by date with a lot of options. In desktop and web apps, you can use a calendar-based date selector by clicking Starting and Ending in the Date section of the filter sidebar.

You can also use a whole bunch of different words in the search field: 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). These terms are converted into entries for the Starting and Ending date selectors.

As an example, you might want to find messages between June 1 and June 30, 2018. You could express this in at least three ways:

  • before:07/01/2018 after:05/31/2018

  • after:2018-05-31 before:2018-07-01

  • If June 2018 is the most recent June for which you’re looking—you’re performing a search before June 2019, that is—you can also just typeduring: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

Search by People or Conversation

Narrowing a search to one or more people or one or more conversations often provides more useful results. In the desktop and web apps’ “Filter by” section, you can check entries that appear or click More, then filter and add more people or conversations.

With text limiters, enter in: followed by a channel name, like in:#pets-cats, or a person’s name, like in:Joe Philpott,Adam Westcoat, which matches within a group DM with those people (Figure 95). A special synonym to find your messages? Use in:me. For DMs sent to you? Enter to:me.

Figure 95: You can limit results to a specific person by specifying from: and their handle.
Figure 95: You can limit results to a specific person by specifying from: and their handle.

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.

Search by Star, Link, or Emoji

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, pinned messages with has:pin, 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.

Limit Search Scope

One final filter available only in the desktop and web apps lets you limit the scope of what’s included in a search. You can choose to include or exclude results from apps and bots with one checkbox and “Channels I’m not a member of” with another. That channels option excludes public channels that you haven’t joined; private channels are only included if you’re a member already.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset