SearchMessagesQueryParams

public final class SearchMessagesQueryParams

by Message class type Search messages Parameter.

Used for com.nexconn.chat.channel.BaseChannel.createSearchMessagesQuery Creates a pagination query object.

internal SearchMessageParams structure Mapping:

  • keyword → keyword

  • limit → pageSize

  • offset → By Query internal Management

  • order → isAscend(false = DESC, true = ASC)

  • timeRange → timeRange

  • conversationFilter → channelFilter (Via Channel Instance Call When auto-fill, Also can be explicitly specified)

  • messageFilter → messageFilter

Usage Example:

val params = SearchMessagesQueryParams(
channel = channel,
keyword = "hello",
messageFilter = MessageFilter(
senderIds = listOf("user_001"),
messageTypes = listOf(MessageType.TEXT, MessageType.IMAGE)
),
timeRange = TimeRange(
startTime = startTimestamp,
endTime = endTimestamp
)
)
val query = BaseChannel.createSearchMessagesQuery(params)

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

@param channelFilter Channel filter conditions, null When By Channel context auto-fill @param messageFilter Message filter conditions (Message class type, Sender), null indicates Not Filter @param pageSize per page Search Result Count, Default 20, Value range (0, 100] @param isAscend Whether ascending order (From Old to New), Default false (Descending, From New to Old) @param messageFilter 消息过滤条件(消息类型、发送者),null 表示不过滤 @param pageSize 每页搜索结果数量,默认 20,取值范围 (0, 100] @param isAscend 是否升序排列(从旧到新),默认 false(降序,从新到旧)

Constructors

Link copied to clipboard
public SearchMessagesQueryParams SearchMessagesQueryParams(BaseChannel channel, String keyword, TimeRange timeRange, ChannelFilter channelFilter, MessageFilter messageFilter, Integer pageSize, Boolean isAscend)

Properties

Link copied to clipboard
private final BaseChannel channel
Link copied to clipboard
Link copied to clipboard
private final Boolean isAscend
Link copied to clipboard
private final String keyword
Link copied to clipboard
Link copied to clipboard
private final Integer pageSize
Link copied to clipboard
private final TimeRange timeRange

Functions

Link copied to clipboard
public final BaseChannel getChannel()
Link copied to clipboard
Link copied to clipboard
public final String getKeyword()
Link copied to clipboard
Link copied to clipboard
public final Integer getPageSize()
Link copied to clipboard
public final TimeRange getTimeRange()
Link copied to clipboard
public final Boolean isAscend()