SearchMessagesQueryParams

public final class SearchMessagesQueryParams

Parameters for creating a paginated message search query.

Used with ai.nexconn.chat.channel.BaseChannel.createSearchMessagesQuery. Supports filtering by keyword, sender user IDs, message types, time range, and channels.

val params = SearchMessagesQueryParams(
keyword = "hello",
channelTypes = listOf(ChannelType.GROUP),
channelIds = listOf("groupId"),
senderUserIds = listOf("user_001"),
messageTypes = listOf(MessageType.TEXT, MessageType.IMAGE),
startTime = startTimestamp,
endTime = endTimestamp
)
val query = BaseChannel.createSearchMessagesQuery(params)

query.loadNextPage { messages, error ->
if (error == null && messages != null) {
// Handle results
}
}

Parameters

keyword

Search keyword

startTime

Query start timestamp (milliseconds), 0 means no start time limit

endTime

Query end timestamp (milliseconds), 0 means no end time limit

channelTypes

Channel type filter; null searches all channel types

channelIds

Channel ID filter; null searches all channels

subChannelIds

Sub-channel ID filter (for community channels); null searches all sub-channels

senderUserIds

Sender user ID filter; null means no sender filtering

messageTypes

Message type filter (object names); null means no message type filtering

pageSize

Number of results per page (default 20, range (0, 100])

isAscending

Whether to sort ascending (oldest first); default false (newest first)

Constructors

Link copied to clipboard
public SearchMessagesQueryParams SearchMessagesQueryParams(String keyword, Long startTime, Long endTime, List<ChannelType> channelTypes, List<String> channelIds, List<String> subChannelIds, List<String> senderUserIds, List<String> messageTypes, Integer pageSize, Boolean isAscending)

Properties

Link copied to clipboard
private final List<String> channelIds
Link copied to clipboard
private final List<ChannelType> channelTypes
Link copied to clipboard
private final Long endTime
Link copied to clipboard
private final Boolean isAscending
Link copied to clipboard
private final String keyword
Link copied to clipboard
private final List<String> messageTypes
Link copied to clipboard
private final Integer pageSize
Link copied to clipboard
private final List<String> senderUserIds
Link copied to clipboard
private final Long startTime
Link copied to clipboard
private final List<String> subChannelIds

Functions

Link copied to clipboard
public final List<String> getChannelIds()
Link copied to clipboard
public final List<ChannelType> getChannelTypes()
Link copied to clipboard
public final Long getEndTime()
Link copied to clipboard
public final String getKeyword()
Link copied to clipboard
public final List<String> getMessageTypes()
Link copied to clipboard
public final Integer getPageSize()
Link copied to clipboard
public final List<String> getSenderUserIds()
Link copied to clipboard
public final Long getStartTime()
Link copied to clipboard
public final List<String> getSubChannelIds()
Link copied to clipboard
public final Boolean isAscending()