slack-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Slack Search

Slack搜索

This skill provides guidance for effectively searching Slack to find messages, files, and information.
本技能提供有效搜索Slack以查找消息、文件和信息的指导方案。

When to Use

使用场景

Apply this skill whenever you need to find information in Slack, including when a user asks you to locate messages, conversations, files, or people, or when you need to gather context before answering a question about what's happening in Slack.
当你需要在Slack中查找信息时即可应用本技能,包括用户要求你定位消息、对话、文件或人员,或是你需要在回复关于Slack内动态的问题前收集上下文信息的场景。

Search Tools Overview

搜索工具概览

ToolUse When
slack_search_public
Searching public channels only. Does not require user consent.
slack_search_public_and_private
Searching all channels including private, DMs, and group DMs. Requires user consent.
slack_search_channels
Finding channels by name or description.
slack_search_users
Finding people by name, email, or role.
工具名称使用场景
slack_search_public
仅搜索公开频道。无需用户授权。
slack_search_public_and_private
搜索所有频道,包括私有频道、一对一私信和群组私信。需要用户授权。
slack_search_channels
通过名称或描述查找频道。
slack_search_users
通过姓名、邮箱或角色查找人员。

Search Strategy

搜索策略

Start Broad, Then Narrow

先宽泛搜索,再逐步缩小范围

  1. Begin with a simple keyword or natural language question.
  2. If too many results, add filters (
    in:
    ,
    from:
    , date ranges).
  3. If too few results, remove filters and try synonyms or related terms.
  1. 从简单关键词或自然语言问题开始搜索。
  2. 如果结果过多,添加筛选条件(
    in:
    from:
    、日期范围)。
  3. 如果结果过少,移除筛选条件,尝试同义词或相关词汇。

Choose the Right Search Mode

选择合适的搜索模式

  • Natural language questions (e.g., "What is the deadline for project X?"): Best for fuzzy, conceptual searches where you don't know exact keywords.
  • Keyword search (e.g.,
    project X deadline
    ): Best for finding specific, exact content.
  • 自然语言提问(例如:“项目X的截止日期是什么时候?”):最适合模糊的概念性搜索,当你不知道确切关键词时使用。
  • 关键词搜索(例如:
    project X deadline
    ):最适合查找特定、精准的内容。

Use Multiple Searches

多次搜索

Don't rely on a single search. Break complex questions into smaller searches:
  • Search for the topic first
  • Then search for specific people's contributions
  • Then search in specific channels
不要依赖单次搜索。将复杂问题拆分为多个小搜索:
  • 先搜索主题相关内容
  • 再搜索特定人员的贡献内容
  • 最后在特定频道内搜索

Search Modifiers Reference

搜索修饰符参考

Location Filters

位置筛选器

  • in:channel-name
    : Search within a specific channel
  • in:<#C123456>
    : Search in channel by ID
  • -in:channel-name
    : Exclude a channel
  • in:<@U123456>
    or
    in:@username
    : Search in DMs with a user
  • in:channel-name
    : 在特定频道内搜索
  • in:<#C123456>
    : 通过频道ID搜索
  • -in:channel-name
    : 排除某个频道
  • in:<@U123456>
    in:@username
    : 在与指定用户的私信中搜索

User Filters

用户筛选器

  • from:<@U123456>
    : Messages from a specific user (by ID)
  • from:username
    : Messages from a user (by Slack username)
  • to:<@U123456>
    : Messages sent to a specific user
  • to:me
    : Messages sent directly to you
  • creator:@username
    : Canvases created by a specific person
  • from:<@U123456>
    : 来自特定用户的消息(通过ID)
  • from:username
    : 来自指定用户的消息(通过Slack用户名)
  • to:<@U123456>
    : 发送给特定用户的消息
  • to:me
    : 直接发送给你的消息
  • creator:@username
    : 由特定人员创建的Canvas

Content Filters

内容筛选器

  • is:thread
    : Only threaded messages
  • is:saved
    : Only your saved messages
  • has:pin
    : Pinned messages
  • has:link
    : Messages containing links
  • has:file
    : Messages with file attachments
  • has::emoji:
    : Messages with a specific reaction
  • hasmy::emoji:
    : Messages you reacted to with a specific reaction
  • is:thread
    : 仅显示线程消息
  • is:saved
    : 仅显示你保存的消息
  • has:pin
    : 已置顶的消息
  • has:link
    : 包含链接的消息
  • has:file
    : 带有文件附件的消息
  • has::emoji:
    : 带有特定表情反应的消息
  • hasmy::emoji:
    : 你用特定表情反应过的消息

Date Filters

日期筛选器

  • before:YYYY-MM-DD
    : Messages before a date
  • after:YYYY-MM-DD
    : Messages after a date
  • on:YYYY-MM-DD
    : Messages on a specific date
  • during:month
    : Messages during a specific month (e.g.,
    during:january
    )
  • before:YYYY-MM-DD
    : 指定日期之前的消息
  • after:YYYY-MM-DD
    : 指定日期之后的消息
  • on:YYYY-MM-DD
    : 指定日期当天的消息
  • during:month
    : 指定月份内的消息(例如:
    during:january

Text Matching

文本匹配

  • "exact phrase"
    : Match an exact phrase
  • -word
    : Exclude messages containing a word
  • wild*
    : Wildcard matching (minimum 3 characters before
    *
    )
  • "exact phrase"
    : 匹配精确短语
  • -word
    : 排除包含指定词汇的消息
  • wild*
    : 通配符匹配(
    *
    前至少需要3个字符)

File Search

文件搜索

To search for files, set the
content_types="files"
parameter and use a
type:
filter in the query:
  • type:images
    ,
    type:documents
    ,
    type:pdfs
    ,
    type:spreadsheets
    ,
    type:presentations
  • type:canvases
    ,
    type:lists
    ,
    type:emails
    ,
    type:audio
    ,
    type:videos
Example:
content_types="files" type:pdfs budget after:2025-01-01
All the standard modifiers above (
in:
,
from:
, dates, etc.) work with file searches too.
要搜索文件,需设置
content_types="files"
参数,并在查询中使用
type:
筛选器:
  • type:images
    ,
    type:documents
    ,
    type:pdfs
    ,
    type:spreadsheets
    ,
    type:presentations
  • type:canvases
    ,
    type:lists
    ,
    type:emails
    ,
    type:audio
    ,
    type:videos
示例:
content_types="files" type:pdfs budget after:2025-01-01
上述所有标准修饰符(
in:
from:
、日期等)同样适用于文件搜索。

Useful Parameters

实用参数

Beyond the query string, the search tools accept parameters that materially improve results:
  • sort
    :
    score
    (relevance, default) or
    timestamp
    (newest first); pair with
    sort_dir
    (
    asc
    /
    desc
    ).
  • content_types
    :
    messages
    (default) or
    files
    .
  • only_my_channels
    : restrict to channels you're a member of.
  • limit
    : results per page (capped at 20); paginate with the returned
    cursor
    .
除查询字符串外,搜索工具还接受可显著优化结果的参数:
  • sort
    :
    score
    (相关性,默认)或
    timestamp
    (最新优先);可搭配
    sort_dir
    asc
    /
    desc
    )使用。
  • content_types
    :
    messages
    (默认)或
    files
  • only_my_channels
    : 仅限制在你加入的频道内搜索。
  • limit
    : 每页结果数量(上限为20);使用返回的
    cursor
    进行分页。

Following Up on Results

搜索结果跟进

After finding relevant messages:
  • Use
    slack_read_thread
    to get the full thread context for any threaded message.
  • Use
    slack_read_channel
    with
    oldest
    /
    latest
    timestamps to read surrounding messages for context.
  • Use
    slack_read_user_profile
    to identify who a user is when their ID appears in results.
  • Use
    slack_read_file
    to read the contents of a file surfaced by a file search.
  • Use
    slack_list_channel_members
    to see who is in a channel you found.
找到相关消息后:
  • 使用
    slack_read_thread
    获取线程消息的完整上下文。
  • 使用
    slack_read_channel
    并搭配
    oldest
    /
    latest
    时间戳读取周边消息以获取上下文。
  • 当结果中出现用户ID时,使用
    slack_read_user_profile
    识别用户身份。
  • 使用
    slack_read_file
    读取文件搜索结果中显示的文件内容。
  • 使用
    slack_list_channel_members
    查看你找到的频道内成员。

Common Pitfalls

常见误区

  • Boolean operators don't work.
    AND
    ,
    OR
    ,
    NOT
    are not supported. Use spaces (implicit AND) and
    -
    for exclusion. (Repeating the same modifier, e.g. two
    from:
    , ORs those values together.)
  • Parentheses don't work. Don't try to group search terms with
    ()
    .
  • Search is not real-time. Very recent messages (last few seconds) may not appear in search results. Use
    slack_read_channel
    for the most recent messages.
  • Private channel access. Use
    slack_search_public_and_private
    when you need to include private channels, but note this requires user consent.
  • 不支持布尔运算符
    AND
    OR
    NOT
    均不被支持。使用空格(隐式AND)和
    -
    来实现排除功能。(重复相同修饰符,例如两个
    from:
    ,会将这些值视为OR关系。)
  • 不支持括号。不要尝试用
    ()
    对搜索词进行分组。
  • 搜索并非实时。最新的消息(过去几秒内)可能不会出现在搜索结果中。如需获取最新消息,请使用
    slack_read_channel
  • 私有频道访问。当需要包含私有频道时,请使用
    slack_search_public_and_private
    ,但请注意这需要用户授权。

Notes

注意事项

  • Scope: this skill owns searching workspace content: messages, files, channels, and people inside Slack. To search and read the official Slack platform documentation at docs.slack.dev (conceptual and how-to questions about Slack features), use the
    slack:slack-docs
    skill instead.
  • 范围:本技能负责搜索Slack内的工作区内容:消息、文件、频道和人员。如需搜索并阅读docs.slack.dev上的官方Slack平台文档(关于Slack功能的概念性和操作类问题),请使用
    slack:slack-docs
    技能。