Skip to main content
CometChatSearch is a composite component that provides a real-time search interface for finding conversations and messages, with support for filters, scopes, and customization options.

When to use this

  • You need a full-screen or embedded search experience that searches across conversations and messages.
  • You want users to find messages, conversations, media, and more through a filterable search interface.
  • You need to scope search results to a specific user or group conversation.
  • You want to customize search filters, result item views, and date/time formatting.
  • You need tap actions on search results for both conversations and messages.

Prerequisites

  • CometChat SDK initialized with CometChatUIKit.init() and a user logged in.
  • The cometchat-chat-uikit-android dependency added to your project.
  • A valid layout XML file or Activity where you will place the component.

Quick start

  1. Open your layout XML file (e.g., activity_search.xml).
  2. Add the CometChatSearch XML element:
activity_search.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ui.activity.SearchActivity">

    <com.cometchat.chatuikit.search.CometChatSearch
        android:id="@+id/cometchat_search"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_constraintTop_toTopOf="parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>
What this does: Adds the CometChatSearch component to your layout inside a ConstraintLayout. It fills the available width and height and renders the search interface for the logged-in user.
  1. Create your Activity class and set up view binding:
SearchActivity.java
public class SearchActivity extends AppCompatActivity {
    private ActivitySearchBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivitySearchBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
    }
}
What this does: Creates a SearchActivity that inflates the layout using view binding and sets it as the content view. The CometChatSearch component defined in the XML renders automatically.
  1. Build and run your app.
  2. Verify that the search interface appears with a search bar and filter options.

Core concepts

  • CometChatSearch: The main composite component class that renders the search interface. It searches across conversations and messages in real time.
  • Actions: Callbacks such as setOnConversationClicked, setOnMessageClicked, setOnBackPressListener, setOnError, and setOnEmpty that let you respond to user interactions and component states.
  • Filters: Use ConversationsRequest.ConversationsRequestBuilder and MessagesRequest.MessagesRequestBuilder to filter search results by conversation or message criteria.
  • Events: The CometChatSearch component does not produce any events.
  • Style: XML theme styles (parent CometChatSearchStyle) applied via setStyle() to customize colors, fonts, and sub-component styles.
  • Advanced views: Methods like setTextMessageItemView, setImageMessageItemView, and conversation view setters that let you replace default UI elements with custom layouts.
  • Functionality: Methods like setUid, setGuid, setSearchFilters, setInitialSearchFilter, and setSearchIn that control search scope and behavior.

Implementation

Actions

What you’re changing: How the component responds to user interactions such as tapping a conversation result, tapping a message result, pressing back, encountering errors, or receiving empty results.
  • Where: Activity where you hold a reference to CometChatSearch via view binding (e.g., binding.cometchatSearch).
  • Applies to: CometChatSearch.
  • Default behavior: The onConversationClicked and onMessageClicked actions do not have predefined behavior. The onBackPressListener, onError, and onEmpty actions listen for their respective states.
  • Override: Call the corresponding setter method to define your own logic.

setOnConversationClicked

Triggered when the user taps a conversation from the search results.
SearchActivity.java
        binding.cometchatSearch.setOnConversationClicked((view, position, conversation) -> {
            Log.d(TAG, "onCreate: Conversation Clicked !");
        });
What this does: Registers a callback that fires when the user taps a conversation in the search results. The callback receives the view, position, and Conversation object.

setOnMessageClicked

Triggered when the user taps a message from the search results.
SearchActivity.java
        binding.cometchatSearch.setOnMessageClicked((view, position, baseMessage) -> {
            Log.d(TAG, "onCreate: Message Clicked !");
        });
What this does: Registers a callback that fires when the user taps a message in the search results. The callback receives the view, position, and BaseMessage object.

setOnBackPressListener

Triggered when the user taps the back button of the search component.
SearchActivity.java
        binding.cometchatSearch.setOnBackPressListener {
            Log.i(TAG, "onCreate: Back Pressed !")
        }
What this does: Registers a callback that fires when the user presses the back button on the search screen. Use this to define custom back navigation logic.

setOnError

Listens for errors that occur in the CometChatSearch component. This does not change the component’s behavior.
SearchActivity.java
        binding.cometchatSearch.setOnError((e -> {
            Log.e(TAG, "onCreate: ", e);
            // Handle Error
        }));
What this does: Registers an error listener on the search component. When an error occurs during search operations, the callback fires with the exception object.

setOnEmpty

Listens for the empty state of the CometChatSearch component. This does not change the component’s behavior.
SearchActivity.java
        binding.cometchatSearch.setOnEmpty(()-> {
            Log.d(TAG, "onCreate: Empty Result !");
        });
What this does: Registers a callback that fires when the search returns no results. Use this to trigger custom empty-state logic.
  • Verify: After setting any action callback, trigger the corresponding interaction (tap a conversation result, tap a message result, press back, cause an error, or search for a term with no results) and confirm your callback executes with the correct parameters.

Filters

What you’re changing: How search results are filtered using request builders for conversations and messages.
  • Where: Activity where you hold a reference to CometChatSearch via view binding (e.g., binding.cometchatSearch).
  • Applies to: CometChatSearch.
  • Default behavior: The component uses default request builders with no custom filters applied.
  • Override: Call setConversationsRequestBuilder or setMessagesRequestBuilder with a configured builder to filter results.

setConversationsRequestBuilder

Sets a ConversationsRequest.ConversationsRequestBuilder to filter conversation search results. For all available builder options, refer to the ConversationRequestBuilder documentation.
SearchActivity.java
        binding.cometchatSearch.setConversationsRequestBuilder(
                new ConversationsRequest.ConversationsRequestBuilder().setLimit(10)
        );
What this does: Configures the search component to use a custom ConversationsRequestBuilder that limits conversation results to 10 items per fetch.

setMessagesRequestBuilder

Sets a MessagesRequest.MessagesRequestBuilder to filter message search results. For all available builder options, refer to the MessagesRequestBuilder documentation.
SearchActivity.java
        binding.cometchatSearch.setMessagesRequestBuilder(
                new MessagesRequest.MessagesRequestBuilder().setLimit(5)
        );
What this does: Configures the search component to use a custom MessagesRequestBuilder that limits message results to 5 items per fetch.
  • Verify: After setting a request builder, perform a search and confirm the results respect the configured filters (e.g., the result count does not exceed the set limit).

Events

The CometChatSearch component does not produce any events.

Style

What you’re changing: The visual appearance of the search component including background colors, text styles, and sub-component styles.
  • Where: themes.xml for style definition, Activity/Fragment for applying the style.
  • Applies to: CometChatSearch.
  • Default behavior: The component uses the default CometChatSearchStyle theme.
  • Override: Define a custom style with parent CometChatSearchStyle in themes.xml and apply it with setStyle().
  • Code:
themes.xml
    <style name="CustomSearchStyle" parent="CometChatSearchStyle">
        <item name="cometchatSearchBackgroundColor">#EDEAFA</item>

        <item name="cometchatSearchFilterChipTextAppearance">@style/textStyleTimesNewRoman</item>

        <item name="cometchatSearchSectionHeaderTextAppearance">@style/textStyleTimesNewRoman</item>
        <item name="cometchatSearchSectionHeaderBackgroundColor">#EDEAFA</item>

        <item name="cometchatSearchConversationItemBackgroundColor">#EDEAFA</item>
        <item name="cometchatSearchConversationSubtitleTextAppearance">@style/textStyleTimesNewRoman</item>
        <item name="cometchatSearchConversationTitleTextAppearance">@style/textStyleTimesNewRoman</item>
        <item name="cometchatSearchConversationTimestampTextAppearance">?attr/cometchatTextAppearanceCaption1Bold</item>

        <item name="cometchatSearchSeeMoreTextAppearance">@style/textStyleTimesNewRoman</item>

        <item name="cometchatSearchMessageItemBackgroundColor">#EDEAFA</item>
        <item name="cometchatSearchMessageTitleTextAppearance">@style/textStyleTimesNewRoman</item>
        <item name="cometchatSearchMessageSubtitleTextAppearance">@style/textStyleTimesNewRoman</item>
        <item name="cometchatSearchMessageTimestampTextAppearance">@style/textStyleTimesNewRoman</item>

        <item name="cometchatSearchBarTextAppearance">@style/textStyleTimesNewRoman</item>
    </style>

    <style name="textStyleTimesNewRoman">
        <item name="android:fontFamily">@font/times_new_roman_regular</item>
    </style>
What this does: Defines a custom search style that sets a light purple background color (#EDEAFA) for the search component, conversation items, and message items, and applies a Times New Roman font to all text elements including filter chips, section headers, conversation titles/subtitles, message titles/subtitles, timestamps, “see more” text, and the search bar.
Apply the style to the component:
binding.cometchatSearch.setStyle(R.style.CustomSearchStyle)
What this does: Applies the CustomSearchStyle theme to the CometChatSearch instance, overriding the default visual appearance with your custom colors and fonts.
To view all available style attributes, visit the attributes file.
  • Verify: After applying the custom style, the search component displays with the specified background color and font styles for all text elements.

Functionality

What you’re changing: Functional behavior of the search component including search scope, filters, visibility toggles, and custom state views.
  • Where: Activity where you hold a reference to CometChatSearch via view binding (e.g., binding.cometchatSearch).
  • Applies to: CometChatSearch.
  • Default behavior: The component searches across all conversations and messages with default filters and views.
  • Override: Call the corresponding setter method to change the behavior.
PropertyDescriptionCode
UserThe UID of the user in whose conversation the search will be performed..setUid(String uid)
GroupThe GUID of the group in whose conversation the search will be performed..setGuid(String guid)
Hide User StatusHides the user’s online/offline status indicator..setHideUserStatus(boolean bool)
Hide Group TypeHides the group type icon in conversation leading view..setHideGroupType(boolean hide)
Search FiltersList of filters to be rendered in the Search component..setSearchFilters(List<UIKitConstants.SearchFilter> filters)
Initial Search FilterThe filter which will be active by default on load..setInitialSearchFilter(UIKitConstants.SearchFilter initialSearchFilter)
Search InList of entities in which the search should be performed..setSearchIn(List<SearchScope> scopes)
Initial ViewCustom view to be shown when CometChat Search is rendered and no search is performed..setInitialView(@LayoutRes int initialView)
Loading ViewA custom component to display during the loading state..setLoadingView(View loadingView)
Empty ViewA custom component to display when there are no conversations available..setEmptyView(@LayoutRes int emptyView)
Error ViewA custom component to display when an error occurs..setErrorView(View errorView)
  • Verify: After setting a functional property (e.g., setUid("user123")), perform a search and confirm the results are scoped to the specified user’s conversation.

Advanced views

What you’re changing: Custom views for conversation items and message items in the search results, date/time formatting, and text formatters.
  • Where: Activity where you hold a reference to CometChatSearch via view binding (e.g., binding.cometchatSearch).
  • Applies to: CometChatSearch.
  • Default behavior: The component uses default views for conversation and message items in search results.
  • Override: Call the corresponding setter method to replace default views with custom layouts.

Conversation item views

The following methods let you customize conversation items in the search results. Each method references the corresponding prop on the CometChatConversations component:
  • ConversationItemView: Assign a custom list item view to a conversation in the search result. For details, refer to the itemView prop of the CometChatConversations component.
  • ConversationLeadingView: Assign a custom leading view to a conversation in the search result. For details, refer to the leadingView prop of the CometChatConversations component.
  • ConversationTitleView: Assign a custom title view to a conversation in the search result. For details, refer to the titleView prop of the CometChatConversations component.
  • ConversationSubtitleView: Assign a custom subtitle view to a conversation in the search result. For details, refer to the subtitleView prop of the CometChatConversations component.
  • ConversationTrailingView: Assign a custom trailing view to a conversation in the search result. For details, refer to the trailingView prop of the CometChatConversations component.

Message item views

Message item view methods let you assign custom views to different types of messages in the search results. For details, refer to the itemView prop of the CometChatMessages component. The following example shows how to override the default message item view with a custom one for text messages. Define a custom layout XML:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="16dp"
        android:background="#E8E4F3">

        <TextView
            android:id="@+id/tv_sender_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="George Alan:"
            android:textColor="#6B4FBB"
            android:textSize="16sp"
            android:textStyle="bold"
            android:layout_marginEnd="4dp" />

        <TextView
            android:id="@+id/tv_message"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="That works for me. Yes, let's go a..."
            android:textColor="#4A4A4A"
            android:textSize="16sp"
            android:ellipsize="end"
            android:maxLines="1" />
    </LinearLayout>
What this does: Defines a custom horizontal layout for a message search result item with a bold purple sender name on the left and a single-line truncated message text on the right.
Set the custom text message item view:
        binding.cometchatSearch.setTextMessageItemView(new MessagesSearchViewHolderListener<TextMessage>() {
            @Override
            public View createView(Context context, View listItem) {
                // Inflate the custom message item view
                LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                return layoutInflater.inflate(R.layout.custom_message_item_view, null);
            }

            @Override
            public void bindView(Context context, View createdView, TextMessage message, RecyclerView.ViewHolder holder, List<BaseMessage> messagesList, int position) {
                // Find the TextView elements
                android.widget.TextView titleTv = createdView.findViewById(R.id.tv_sender_name);
                android.widget.TextView messageTv = createdView.findViewById(R.id.tv_message);

                // Bind the message data to the views
                if (message != null) {
                    titleTv.setText(message.getSender().getName());
                    messageTv.setText(message.getText());
                }
            }
        });
What this does: Registers a MessagesSearchViewHolderListener for text messages. The createView method inflates the custom layout, and bindView populates the sender name and message text from the TextMessage object.
The following message item view methods are available for customization:
FunctionMessage Type
setTextMessageItemViewText Message
setImageMessageItemViewImage Message
setVideoMessageItemViewVideo Message
setAudioMessageItemViewAudio Message
setDocumentMessageItemViewDocument Message
setLinkMessageItemViewLink Message

Date/time formatters

setDateTimeFormatter
Provides a custom implementation of DateTimeFormatterCallback to configure how time and date values are displayed in search results. Each method in the interface corresponds to a specific case:
  • time(long timestamp) — Custom full timestamp format
  • today(long timestamp) — Called when a message is from today
  • yesterday(long timestamp) — Called for yesterday’s messages
  • lastWeek(long timestamp) — Messages from the past week
  • otherDays(long timestamp) — Older messages
  • minute(long timestamp) / hour(long timestamp) — Exact time unit
  • minutes(long diffInMinutesFromNow, long timestamp) — e.g., “5 minutes ago”
  • hours(long diffInHourFromNow, long timestamp) — e.g., “2 hours ago”
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;


cometChatSearch.setDateTimeFormatter(new DateTimeFormatterCallback() {

        private final SimpleDateFormat fullTimeFormatter = new SimpleDateFormat("hh:mm a", Locale.getDefault());
        private final SimpleDateFormat dateFormatter = new SimpleDateFormat("dd MMM yyyy", Locale.getDefault());

        @Override
        public String time(long timestamp) {
            return fullTimeFormatter.format(new Date(timestamp));
        }

        @Override
        public String today(long timestamp) {
            return "Today";
        }

        @Override
        public String yesterday(long timestamp) {
            return "Yesterday";
        }

        @Override
        public String lastWeek(long timestamp) {
            return "Last Week";
        }

        @Override
        public String otherDays(long timestamp) {
            return dateFormatter.format(new Date(timestamp));
        }

        @Override
        public String minutes(long diffInMinutesFromNow, long timestamp) {
            return diffInMinutesFromNow + " mins ago";
        }

        @Override
        public String hours(long diffInHourFromNow, long timestamp) {
            return diffInHourFromNow + " hrs ago";
        }
    });
What this does: Provides a custom date/time formatter that displays “Today”, “Yesterday”, “Last Week” for recent messages, a “dd MMM yyyy” format for older messages, and relative time strings like “5 mins ago” or “2 hrs ago” for recent activity.

Text formatters

setTextFormatters
Enables developers to define and apply text formatters that dynamically modify or transform message content before rendering it in the UI. Text formatters can be used for:
  • Automatically converting URLs into clickable links
  • Applying Markdown or rich text styling
  • Replacing certain words or patterns with emojis or predefined text
  • Censoring specific words for moderation
For implementation details, refer to the MentionsFormatter Guide.
  • Verify: After setting any advanced view, confirm the custom view renders in the correct position within the search result items, and the data binding populates correctly for each result.

Customization matrix

What you want to changeWhereProperty/APIExample
Search background colorthemes.xmlCometChatSearchStyle with cometchatSearchBackgroundColor<item name="cometchatSearchBackgroundColor">#EDEAFA</item>
Filter chip text stylethemes.xmlCometChatSearchStyle with cometchatSearchFilterChipTextAppearance<item name="cometchatSearchFilterChipTextAppearance">@style/YourStyle</item>
Section header text stylethemes.xmlCometChatSearchStyle with cometchatSearchSectionHeaderTextAppearance<item name="cometchatSearchSectionHeaderTextAppearance">@style/YourStyle</item>
Section header background colorthemes.xmlCometChatSearchStyle with cometchatSearchSectionHeaderBackgroundColor<item name="cometchatSearchSectionHeaderBackgroundColor">#EDEAFA</item>
Conversation item background colorthemes.xmlCometChatSearchStyle with cometchatSearchConversationItemBackgroundColor<item name="cometchatSearchConversationItemBackgroundColor">#EDEAFA</item>
Conversation title text stylethemes.xmlCometChatSearchStyle with cometchatSearchConversationTitleTextAppearance<item name="cometchatSearchConversationTitleTextAppearance">@style/YourStyle</item>
Conversation subtitle text stylethemes.xmlCometChatSearchStyle with cometchatSearchConversationSubtitleTextAppearance<item name="cometchatSearchConversationSubtitleTextAppearance">@style/YourStyle</item>
Conversation timestamp text stylethemes.xmlCometChatSearchStyle with cometchatSearchConversationTimestampTextAppearance<item name="cometchatSearchConversationTimestampTextAppearance">?attr/cometchatTextAppearanceCaption1Bold</item>
”See more” text stylethemes.xmlCometChatSearchStyle with cometchatSearchSeeMoreTextAppearance<item name="cometchatSearchSeeMoreTextAppearance">@style/YourStyle</item>
Message item background colorthemes.xmlCometChatSearchStyle with cometchatSearchMessageItemBackgroundColor<item name="cometchatSearchMessageItemBackgroundColor">#EDEAFA</item>
Message title text stylethemes.xmlCometChatSearchStyle with cometchatSearchMessageTitleTextAppearance<item name="cometchatSearchMessageTitleTextAppearance">@style/YourStyle</item>
Message subtitle text stylethemes.xmlCometChatSearchStyle with cometchatSearchMessageSubtitleTextAppearance<item name="cometchatSearchMessageSubtitleTextAppearance">@style/YourStyle</item>
Message timestamp text stylethemes.xmlCometChatSearchStyle with cometchatSearchMessageTimestampTextAppearance<item name="cometchatSearchMessageTimestampTextAppearance">@style/YourStyle</item>
Search bar text stylethemes.xmlCometChatSearchStyle with cometchatSearchBarTextAppearance<item name="cometchatSearchBarTextAppearance">@style/YourStyle</item>
Apply a custom styleActivity/FragmentsetStyle(int styleRes)binding.cometchatSearch.setStyle(R.style.CustomSearchStyle)
Scope search to a userActivity/FragmentsetUid(String uid).setUid("user123")
Scope search to a groupActivity/FragmentsetGuid(String guid).setGuid("group123")
Hide user online statusActivity/FragmentsetHideUserStatus(boolean bool).setHideUserStatus(true)
Hide group type iconActivity/FragmentsetHideGroupType(boolean hide).setHideGroupType(true)
Set search filtersActivity/FragmentsetSearchFilters(List<UIKitConstants.SearchFilter> filters).setSearchFilters(filters)
Set initial active filterActivity/FragmentsetInitialSearchFilter(UIKitConstants.SearchFilter initialSearchFilter).setInitialSearchFilter(filter)
Set search scopeActivity/FragmentsetSearchIn(List<SearchScope> scopes).setSearchIn(scopes)
Custom initial viewActivity/FragmentsetInitialView(@LayoutRes int initialView).setInitialView(R.layout.your_initial_view)
Custom loading viewActivity/FragmentsetLoadingView(View loadingView).setLoadingView(loadingView)
Custom empty viewActivity/FragmentsetEmptyView(@LayoutRes int emptyView).setEmptyView(R.layout.your_empty_view)
Custom error viewActivity/FragmentsetErrorView(View errorView).setErrorView(errorView)
Filter conversation resultsActivity/FragmentsetConversationsRequestBuilder(ConversationsRequestBuilder)See Filters code above
Filter message resultsActivity/FragmentsetMessagesRequestBuilder(MessagesRequestBuilder)See Filters code above
Custom text message item viewActivity/FragmentsetTextMessageItemView(MessagesSearchViewHolderListener)See Advanced views code above
Custom image message item viewActivity/FragmentsetImageMessageItemView(MessagesSearchViewHolderListener)See setTextMessageItemView pattern
Custom video message item viewActivity/FragmentsetVideoMessageItemView(MessagesSearchViewHolderListener)See setTextMessageItemView pattern
Custom audio message item viewActivity/FragmentsetAudioMessageItemView(MessagesSearchViewHolderListener)See setTextMessageItemView pattern
Custom document message item viewActivity/FragmentsetDocumentMessageItemView(MessagesSearchViewHolderListener)See setTextMessageItemView pattern
Custom link message item viewActivity/FragmentsetLinkMessageItemView(MessagesSearchViewHolderListener)See setTextMessageItemView pattern
Date/time formattingActivity/FragmentsetDateTimeFormatter(DateTimeFormatterCallback)See setDateTimeFormatter code above

Common pitfalls & fixes

PitfallFix
Component does not renderEnsure CometChatUIKit.init() is called and awaited before using any UI Kit component. If init() has not completed, the component will not load data.
Search returns no results despite existing dataVerify that a user is logged in with CometChatUIKit.login() before displaying the component. The component fetches data for the logged-in user only.
Search scoped to wrong conversationIf you called setUid() or setGuid(), verify the UID or GUID matches an existing user or group. If both are set, the last one called takes precedence.
Custom style not visibleVerify the style parent is CometChatSearchStyle and that you call setStyle(R.style.YourStyle) on the component instance.
setOnConversationClicked not firingEnsure you set the listener before the component loads data. If the listener is set after results are displayed, it may not attach to existing items.
setOnMessageClicked not firingEnsure you set the listener before the component loads data. If the listener is set after results are displayed, it may not attach to existing items.
Filters not applied to search resultsEnsure you call setConversationsRequestBuilder() or setMessagesRequestBuilder() on the CometChatSearch instance after creating and configuring the builder.
Custom message item view not renderingEnsure createView in your MessagesSearchViewHolderListener returns a valid inflated View, not null. If createView returns null, the default view is used.
Date/time format not changingIn Java, use setDateTimeFormatter(). In Kotlin, use setDateTimeFormatterCallback(). Verify you are calling the correct method for your language variant.
Initial view not showingEnsure you pass a valid @LayoutRes resource ID to setInitialView(). The view displays only when no search has been performed.

FAQ

Q: Can I scope the search to a specific user or group conversation? A: Yes. Call setUid(String uid) to scope search to a specific user’s conversation, or setGuid(String guid) to scope search to a specific group’s conversation. Q: Does CometChatSearch emit any events? A: No. The CometChatSearch component does not produce any events. Use the action callbacks (setOnConversationClicked, setOnMessageClicked, etc.) to respond to user interactions. Q: How do I customize the view for a specific message type in search results? A: Use the corresponding message item view setter (e.g., setTextMessageItemView, setImageMessageItemView) with a MessagesSearchViewHolderListener that implements createView and bindView. Q: How do I filter which conversations or messages appear in search results? A: Use setConversationsRequestBuilder() with a configured ConversationsRequest.ConversationsRequestBuilder for conversation results, and setMessagesRequestBuilder() with a configured MessagesRequest.MessagesRequestBuilder for message results. Q: How do I customize conversation items in the search results? A: Use the conversation view setters (ConversationItemView, ConversationLeadingView, ConversationTitleView, ConversationSubtitleView, ConversationTrailingView). Each references the corresponding prop on the CometChatConversations component.

Next steps