Search group channels by name, URL, or other filters
You can search for specific group channels by using several types of search filters within the GroupChannelListQuery and PublicGroupChannelListQuery classes.
Search private group channels
A GroupChannelListQuery instance provides many types of search filters such as channelNameContainsFilter and channelUrlsFilter. You can use these filters to search for specific private group channels.
The sample code below shows the query instance, which returns a list of the current user's group channels that partially match the specified keyword in channelNameContainsFilter in their channel names.
The following shows the query instance that returns a list of the current user's group channels that partially match the specified keywords in channelUrlsFilter in their channel URLs.
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 |
|---|---|
customTypesFilter | Group channels with one or more specified custom types. You can enable this filter using the |
customTypeStartsWithFilter | 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 |
channelUrlsFilter | 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 |
hiddenChannelFilter | Group channels with the specified state and operating behavior. You can enable this filter using the |
myMemberStateFilter | Group channels based on whether the user has accepted an invitation. You can enable this filter using the |
userIdsExactFilter | Group channels that contain members with one or more specified user IDs. You can enable this filter using the |
userIdsIncludeFilter | Group channels that include one or more members with the specified user IDs. You can enable this filter using the |
nicknameContainsFilter | Group channels with members whose nicknames contain the specified value. You can enable this filter using the |
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 |
Search public group channels
A PublicGroupChannelListQuery instance provides many types of search filters such as channelNameContainsFilter and channelUrlsFilter. 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 channelUrlsFilter 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 |
customTypeStartsWithFilter | 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 |
channelUrlsFilter | 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() method. A Supergroup channel is determined by the groupChannel.isSuper property. If the property has a value of true, the channel is a Supergroup channel.