searchMessages

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

根据关键字搜索指定会话中的消息。

注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。

Parameters

conversationType

指定的会话类型。

targetId

指定的会话 id。

keyword

搜索的关键字。

count

返回的搜索结果数量, 传 0 时会返回所有搜索到的消息, 非 0 时,逐页返回。

beginTime

查询 beginTime 之前的消息, 传 0 时从最新消息开始搜索,从该时间往前搜索。

resultCallback

搜索结果回调。