searchMessages

public abstract void searchMessages(ConversationType conversationType, String targetId, String keyword, int count, long beginTime, RongIMClient.ResultCallback<List<Message>> resultCallback)

Searches for messages in a specified conversation based on a keyword.

Note: To make custom messages searchable, implement the getSearchableWord method in your custom message class.

Parameters

conversationType

The type of the specified conversation.

targetId

The ID of the specified conversation.

keyword

The keyword to search for.

count

The number of search results to return. Pass 0 to return all matching messages; otherwise, results are returned page by page.

beginTime

Specifies the time before which messages should be searched. Pass 0 to start searching from the latest message and move backward in time.

resultCallback

Callback for the search results.