> ## Documentation Index
> Fetch the complete documentation index at: https://learn.social.plus/llms.txt
> Use this file to discover all available pages before exploring further.

# Search chats & messages

> Powerful search capabilities across channels and messages for efficient chat navigation and content discovery

<Info>
  **Key Benefit**: Dramatically improve user experience by allowing users to instantly find past conversations, locate important messages, and navigate large chat histories with powerful dual-mode search capabilities.
</Info>

## Feature Overview

The Chat Search UIKit provides comprehensive search functionality that enables users to quickly find conversations and locate specific message content. It offers two distinct search modes optimized for different use cases - searching for channels by name and searching for specific message content across all conversations.

<CardGroup cols={2}>
  <Card title="Chat Search Mode" icon="hashtag">
    **Find Conversations Fast**

    * Search by channel name and participants
    * Real-time result updates
    * Covers both conversation and community channels
    * Archive status visibility
  </Card>

  <Card title="Message Search Mode" icon="magnifying-glass">
    **Locate Specific Content**

    * Full-text search across messages
    * Context preview with highlights
    * Jump to message in conversation
    * Sender information display
  </Card>
</CardGroup>

<CardGroup cols={2}>
  <Card title="Performance" icon="bolt">
    **Optimized Experience**

    * Efficient server-side indexing
    * Instant search results
    * Real-time updates
    * Minimal resource usage
  </Card>

  <Card title="Archive Integration" icon="box-archive">
    **Complete Coverage**

    * Search archived channels
    * Clear archive indicators
    * Access archived content
    * Seamless navigation
  </Card>
</CardGroup>

<Info>
  **Platform Support**: Chat Search is available on **Flutter** (standalone `AmitySearchChannelPage`) and **React Web** (reached from the chat home page — see the React note below). Refer to the platform UIKit for iOS and Android availability.
</Info>

## Implementation Guide

<Tabs>
  <Tab title="Chat Search">
    **Find channels and conversations**

    Search across conversation and community channels to quickly locate chats by name or participants.

    ### Search Page

    The AmitySearchChannelPage provides a unified search interface with tab-based navigation between Chat and Message search modes.

    ### Features

    | Feature              | Description                                |
    | -------------------- | ------------------------------------------ |
    | Channel Name Search  | Search by display name of channels         |
    | Real-time Results    | Results update instantly as you type       |
    | Channel Type Support | Includes conversations and community chats |
    | Last Message Preview | Shows preview of most recent message       |
    | Archive Indicator    | Displays archive status for each channel   |
    | Quick Navigation     | Tap result to open channel immediately     |

    ### Code Examples

    <CodeGroup>
      ```dart Flutter - Search Page theme={null}
      Widget searchPage() {
        return AmitySearchChannelPage();
      }
      ```
    </CodeGroup>

    <Note>
      **Search Scope**: Chat Search mode searches across both active and archived channels, with clear indicators showing which channels are archived.
    </Note>

    <Info>
      **React Web**: Search is not a standalone exported page on React Web. It is reached from `AmityChatHomePage` via the header search entry, which opens the search view with the Chat / Message tabs. The Chat tab is backed by the SDK's `ChannelRepository.searchChannels` (member channels of type `conversation` and `community`, sorted by last activity), and archived channels are indicated inline. No extra wiring is required — enable the chat home page and search is available.
    </Info>
  </Tab>

  <Tab title="Message Search">
    **Search within message content**

    Perform full-text search across all messages to find specific content, discussions, or shared information.

    ### Features

    | Feature              | Description                                  |
    | -------------------- | -------------------------------------------- |
    | Full-Text Search     | Search across all message text content       |
    | Context Preview      | View message snippets with highlighted terms |
    | Jump to Message      | Navigate directly to message in conversation |
    | Sender Information   | See who sent each matching message           |
    | Timestamp Display    | View when messages were sent                 |
    | Multi-Channel Search | Search across all accessible channels        |

    ### Code Examples

    <CodeGroup>
      ```dart Flutter - Message Search theme={null}
      Widget searchPage() {
        // Same component provides both search modes
        // Users switch between Chat and Message tabs
        return AmitySearchChannelPage();
      }
      ```
    </CodeGroup>

    <Note>
      **Automatic Features**: The search page automatically handles real-time updates, result filtering, and navigation through the underlying SDK.
    </Note>
  </Tab>
</Tabs>

## Search Management Strategies

<AccordionGroup>
  <Accordion title="Search Experience Design" icon="magnifying-glass">
    **Creating intuitive search flows**

    Design clear entry points to search functionality from your chat interface. Consider placing search prominently in navigation, providing keyboard shortcuts for power users, and ensuring smooth transitions between search results and conversations.
  </Accordion>

  <Accordion title="Performance Optimization" icon="bolt">
    **Handling large conversation volumes**

    The search component automatically handles performance optimization through server-side indexing and efficient result delivery. Real-time updates ensure users always see the most current results without manual refresh.
  </Accordion>

  <Accordion title="Privacy & Permissions" icon="shield-check">
    **Maintaining access control**

    Search results automatically respect user permissions and channel access. Private channels only appear for members, and deleted messages are excluded from results. Archive status reflects each user's individual settings.
  </Accordion>
</AccordionGroup>

## Best Practices

<AccordionGroup>
  <Accordion title="User Experience Optimization" icon="user-check">
    **Designing effective search interactions**

    Make search easily discoverable in your chat interface, provide clear visual feedback during search operations, and ensure smooth navigation from search results to conversations. Consider adding search to your main navigation for quick access.
  </Accordion>

  <Accordion title="Search Result Presentation" icon="list">
    **Displaying relevant information**

    The search component automatically provides context through message previews, timestamps, and sender information. Ensure your UI design gives adequate space for these details to help users identify the correct results.
  </Accordion>

  <Accordion title="Archive Integration" icon="box-archive">
    **Managing archived content**

    Search includes both active and archived channels with clear indicators. Plan how users will interact with archived results and ensure they understand archive status before accessing content.
  </Accordion>
</AccordionGroup>

## Related Features

<CardGroup cols={3}>
  <Card title="Recent Chats" href="/uikit/components/chat/recent-chats" icon="list">
    **Chat Management**
    Organize and navigate conversations
  </Card>

  <Card title="Group Chat" href="/uikit/components/chat/group-chat" icon="users">
    **Multi-user Conversations**
    Create and manage group chats
  </Card>

  <Card title="Conversation Chat" href="/uikit/components/chat/conversation-chat" icon="comments">
    **Individual Messaging**
    One-on-one conversation features
  </Card>
</CardGroup>

<Tip>
  **Implementation Strategy**: Start with AmitySearchChannelPage to provide immediate search capabilities across your chat application. The component integrates seamlessly with other chat features and requires minimal setup.
</Tip>
