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>
    — Search in DMs with a user
  • in:channel-name
    — 在特定频道内搜索
  • in:<#C123456>
    — 通过频道ID搜索
  • -in:channel-name
    — 排除某个频道
  • in:<@U123456>
    — 在与特定用户的一对一私信中搜索

User Filters

用户筛选符

  • from:<@U123456>
    — Messages from a specific user (by ID)
  • from:username
    — Messages from a user (by Slack username)
  • to:me
    — Messages sent directly to you
  • from:<@U123456>
    — 来自特定用户的消息(通过用户ID)
  • from:username
    — 来自特定用户的消息(通过Slack用户名)
  • to:me
    — 直接发送给你的消息

Content Filters

内容筛选符

  • is:thread
    — Only threaded messages
  • has:pin
    — Pinned messages
  • has:link
    — Messages containing links
  • has:file
    — Messages with file attachments
  • has::emoji:
    — Messages with a specific reaction
  • is:thread
    — 仅显示线程消息
  • has:pin
    — 已置顶的消息
  • has:link
    — 包含链接的消息
  • has:file
    — 带有文件附件的消息
  • has::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, use the
content_types="files"
parameter with type filters:
  • type:images
    — Image files
  • type:documents
    — Document files
  • type:pdfs
    — PDF files
  • type:spreadsheets
    — Spreadsheet files
  • type:canvases
    — Slack Canvases
Example:
content_types="files" type:pdfs budget after:2025-01-01
要搜索文件,需使用
content_types="files"
参数并搭配类型筛选符:
  • type:images
    — 图片文件
  • type:documents
    — 文档文件
  • type:pdfs
    — PDF文件
  • type:spreadsheets
    — 电子表格文件
  • type:canvases
    — Slack Canvases
示例:
content_types="files" type:pdfs budget after:2025-01-01

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.
找到相关消息后:
  • 使用
    slack_read_thread
    获取任何线程消息的完整上下文。
  • 使用带有
    oldest
    /
    latest
    时间戳的
    slack_read_channel
    读取周边消息以获取上下文。
  • 当结果中出现用户ID时,使用
    slack_read_user_profile
    识别该用户身份。

Common Pitfalls

常见误区

  • Boolean operators don't work.
    AND
    ,
    OR
    ,
    NOT
    are not supported. Use spaces (implicit AND) and
    -
    for exclusion.
  • 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)和
    -
    表示排除。
  • 括号无效:不要尝试用
    ()
    对搜索词进行分组。
  • 搜索非实时:最近几秒的消息可能不会出现在搜索结果中。如需查看最新消息,请使用
    slack_read_channel
  • 私有频道访问:当你需要包含私有频道时,请使用
    slack_search_public_and_private
    ,但注意这需要用户授权。