V2TimMessageSearchParam

Introduction

The parameters used for searching for messages.

Parameter introduction

conversationID

  • Parameter type : string
  • Parameter description : Search all conversations or a specified conversation.

conversationID == null: search all conversations

conversationID != null: search a specified conversation

keywordList

  • Parameter type : string[]
  • Parameter description : 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.

type

userIDList

  • Parameter type : string[]
  • Parameter description : userIDs for message sending. Up to 5 userIDs are supported.

messageTypeList

  • Parameter type : number[]
  • Parameter description : The message types to search. If do not specified, all message types supported are searched (V2TIMFaceElem and V2TIMGroupTipsElem are not supported).

searchTimePosition

  • Parameter type : number
  • Parameter description : 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

  • Parameter type : number
  • Parameter description : 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.

pageSize

  • Parameter type : number
  • Parameter description : Number 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 number of search results without pagination may cause performance issues.

pageIndex

  • Parameter type : number
  • Parameter description : 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.

results matching ""

    No results matching ""