SDKsHarmonyOSEnterprise
Search conversations
Search local conversation records matching keyword strings in display names.
Perform full-text keyword searches across locally synchronized conversation titles and remarks:
Code example
import sdk, { SearchConversationReq, SearchConversationResp } from '@openimsdk/imsdk';
const request: SearchConversationReq = {
searchParam: keyword.trim(),
};
const response: SearchConversationResp = await sdk.searchConversation(request);
renderConversationResults(response.conversationList);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
searchParam | string | Yes | Search keyword string. |
Return value
Returns a Promise that resolves to a SearchConversationResp object:
| Property | Type | Description |
|---|---|---|
conversationList | IMConversation[] | List of matched conversation records from local storage. |
State changes after the call
Search executes purely against the local SQLite database; it does not issue remote server requests. Update matching search results when real-time conversation changes arrive by checking conversationID. For conversation event listeners, see Retrieve conversation list.
Was this page helpful?