IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.

Public Member Functions

 V2TIMMessageSearchParam ()
 V2TIMMessageSearchParam (const V2TIMMessageSearchParam &)
V2TIMMessageSearchParamoperator= (const V2TIMMessageSearchParam &)
 ~V2TIMMessageSearchParam ()

Data Fields

V2TIMStringVector keywordList
V2TIMKeywordListMatchType keywordListMatchType
V2TIMStringVector senderUserIDList
V2TIMElemTypeVector messageTypeList
V2TIMString conversationID
uint32_t searchTimePosition
uint32_t searchTimePeriod
uint32_t pageIndex
uint32_t pageSize
uint32_t searchCount
V2TIMString searchCursor

Constructor & Destructor Documentation

◆ V2TIMMessageSearchParam() [1/2]

◆ V2TIMMessageSearchParam() [2/2]

◆ ~V2TIMMessageSearchParam()

Member Function Documentation

◆ operator=()

Field Documentation

◆ keywordList

V2TIMStringVector keywordList

The keyword list can contain up to 5 keywords. When the sender and type of the message are not specified, the keyword list must be non-empty. Otherwise, the keyword list can be empty.

◆ keywordListMatchType

V2TIMKeywordListMatchType keywordListMatchType

Set the keyword list matching type, which can be the OR or AND relationship search. The options are V2TIM_KEYWORD_LIST_MATCH_TYPE_OR (default) and V2TIM_KEYWORD_LIST_MATCH_TYPE_AND.

◆ senderUserIDList

V2TIMStringVector senderUserIDList

Set userIDs for message sending. Up to 5 userIDs are supported.

◆ messageTypeList

V2TIMElemTypeVector messageTypeList

Set the message types to search. If an empty array is passed in, all message types supported are searched (V2TIMFaceElem and V2TIMGroupTipsElem are not supported).

◆ conversationID

V2TIMString conversationID

Search all conversations or a specified conversation

conversationID == null: search all conversations

conversationID != null: search a specified conversation. Unique ID of a conversation. For one-to-one chats, the value format is "c2c_userID". For group chats, the value format is "group_groupID".

◆ searchTimePosition

uint32_t searchTimePosition

Start time for search. The default value is 0, indicating to start search now. The value can also be the UTC timestamp, in seconds.

◆ searchTimePeriod

uint32_t searchTimePeriod

A time period in the past starting from the start time, in seconds. The default value 0 indicates that the time range is not limited. The value 24x60x60 indicates the past day.

◆ pageIndex

uint32_t pageIndex

Page number: used for the paginated display of the search results. Page numbers must start from 0. For example, to display 10 results per page, call the API according to the following rules:

  • First call: call searchLocalMessage with pageSize being set to 10 and pageIndex to 0. Then you can get the total number of results from totalCount in the callback.
  • Page quantity calculation: totalPage = (totalCount % pageSize == 0) ? (totalCount / pageSize) : (totalCount / pageSize + 1)
  • Second call: specify pageIndex (pageIndex < totalPage) to return the subsequent page number.
Valid only for interface searchLocalMessages

◆ pageSize

uint32_t pageSize

Count of results per page: used for the paginated display of the search results. If you do not want to paginate the search results, set the parameter to 0. However, a large count of search results without pagination may cause performance issues.

Valid only for interface searchLocalMessages

◆ searchCount

uint32_t searchCount

Count of cloud search results

Valid only for interface searchCloudMessages

◆ searchCursor

V2TIMString searchCursor

The starting position for cloud search. Set an empty string for the first time, and pass in the value of searchCursor in V2TIMMessageSearchResult when continuing to search.

Valid only for interface searchCloudMessages