Search group channels by name, URL, or other filters
You can search for specific group channels by adding keywords to a GroupChannelListQuery
instance. There are three types of keywords that can be used: name, URL, and custom type.
Search private group channels
A GroupChannelListQuery
instance provides many types of search filters such as ChannelNameContains
and ChannelUrls
filters.
The code sample below shows the query instance which returns a list of group channels that partially match the specified channelNameContains
keyword in their channel names.
The following shows the query instance which returns a list of group channels that partially match the specified channelUrls
keyword in their channel URLs.
You can also search for group channels with a specific custom type by setting customTypes
as in the following code.
The following table shows all filters supported in GroupChannelListQuery
to search for specific channels you want to retrieve. You can use any of the filters in a similar fashion with the sample code above.
List of filters
Name | Filters |
---|---|
customTypes | Group channels with one or more specified custom types. You can enable this filter using the |
customTypeStartWith | Group channels with a custom type that starts with the specified value. You can enable this filter using the |
channelNameContains | Group channels that contain the specified value in their names. You can enable this filter using the |
channelUrls | Group channels with one or more specified channel URLs. You can enable this filter using the |
superChannelFilter | Either super or nonsuper group channels. Using the |
publicChannelFilter | Either public or private group channels. Using the |
unreadChannelFilter | Group channels with one or more unread messages. Using the |
channelHiddenStateFilter | Group channels with the specified state and operating behavior. You can enable this filter using the |
memberStateFilter | Group channels based on whether the user has accepted an invitation. You can enable this filter using the |
userIdsExactlyIn | Group channels that contain members with one or more specified user IDs. You can enable this filter using the |
userIdsIncludeIn | Group channels that include one or more members with the specified user IDs. You can enable this filter using the |
nicknameContains | Group channels with members whose nicknames contain the specified value. You can enable this filter using the |
metaDataOrderKey | Group channels with metadata containing an item with the specified value as its key. This filter is effective only when the metadata are sorted in alphabetical order. You can enable this filter using the |
Search public group channels
A PublicGroupChannelListQuery
instance provides many types of search filters such as channelNameContainsFilter
and channelUrls
. You can use these filters to search for specific public group channels.
The sample code below shows the query instance, which returns the current user's public group channels that partially match the specified keyword in channelNameContainsFilter
in their channel names.
The following shows the query instance, which returns a list of the current user's group channels that partially match the specified keyword in channelUrls
in their channel URLs.
The following table shows all filters supported in PublicGroupChannelListQuery
to search for specific channels you want to retrieve. You can use any of the filters in a similar fashion with the sample code above.
List of filters
Name | Filters |
---|---|
customTypesFilter | Group channels with one or more specified custom types. You can enable this filter using the |
customTypeStartWithFilter | Group channels with a custom type that starts with the specified value. You can enable this filter using the |
channelNameContainsFilter | Group channels that contain the specified value in their names. You can enable this filter using the |
channelUrls | Group channels with one or more specified channel URLs. You can enable this filter using the |
superChannelFilter | Either super or nonsuper group channels. Using the |
membershipFilter | Specifies public group channels to retrieve based on membership. Acceptable values are |
metaDataOrderKeyFilter | Group channels with metadata containing an item with the specified value as its key. This filter is effective only when the metadata are sorted in alphabetical order. You can enable this filter using the |
Retrieve a list of Supergroup channels using a filter
You can retrieve a list of Supergroup channels through the GroupChannelListQuery
's superChannelFilter
property. A Supergroup channel is determined by the groupChannel.isSuper
property. If the property has a value of true
, the channel is a Supergroup channel.