Last Edit: Mar 03 2020

Message search is built-in to the chat API. You can enable and/or disable the search indexing on a per chat type basis. The command shown below selects the channels in which John is a member. Next, it searches the messages in those channels for the keyword “'supercalifragilisticexpialidocious'”:

const filters = { members: { $in: ['john'] } };

const search = await
   { limit: 2, offset: 0 },

final ArrayList<string> searchUsersList = new ArrayList&lt;&gt;();

final FilterObject filter ="members", searchUsersList);

SearchMessagesRequest searchMessagesRequest = new SearchMessagesRequest(filter,

    new SearchMessagesCallback() {
        public void onSuccess(SearchMessagesResponse response) {


        public void onError(String errMsg, int errCode) {


// Search with default filter where the current user is a member of channels.
// Default pagination is 20 messages. "supercalifragilisticexpialidocious")
    .subscribe(onNext: { messages in
    .disposed(by: disposeBag)

// A custom filter and the next page for the results. filter, query: "supercalifragilisticexpialidocious", pagination: .limit(20) + .offset(20))
    .subscribe(onNext: { messages in
    .disposed(by: disposeBag)

val offset = 0
val limit = 10
val query = "supercalifragilisticexpialidocious"

        offset, limit,
        Filters.`in`("members", listOf("john"))
).enqueue {
    val messages =

$filters = [ 'type' => 'messaging' , 'members' => [ '$in' => ['jenny'] ]];

$response = $client->search(
	['limit' => 2, 'offset' => 0]

Pagination works via the standard limit and offset parameters. The first argument, filter, uses a MongoDB style query expression.

We do not run MongoDB on the backend, so only a subset of the standard MongoDB filters are supported.