Clarification on ChannelList queries

Hey folks, I’ve been working on a custom search box to query which channels to load. The idea is to grab this input value and pass it down to the <ChannelList>.queries prop.

When working with only one filter at a time (for example queries.channelListQuery.nicknameContainsFilter) it works great, however, when trying to use more than one filter at a time it seems to behave as an AND and both filter conditions have to be met for a channel to be fetched.

This is my code, quite simple when it comes to the query part:

<ChannelList renderChannelPreview={(previewProps) => (
    <CustomConversationPreview
    ...
    />
  )}
  queries={{
    channelListQuery: {
      channelNameContainsFilter: searchValue,
      nicknameContainsFilter: searchValue,
    },
  }}
/>

With this, I see that the component only loads group channels that have both the searchValue as part of the channel name AND the member’s nicknames. Is there any way to make it behave as an OR and load channels that meet any of the conditions?

Hi @josebra,

Welcome to the Sendbird Community.

This would be considered expected behavior, as the channelListQuery, is making a my_group_channels query (reference) underneath.

We do have the search_query and search_fields on the Platform API that would achieve what you’re looking for however they do not appear to be supported in the UIKit. I’ll flag this to our Engineering team and see if this is something we could potentially include in a future release.

Hi @Tyler

Thanks for the answer, good to know the underlying implementation, this is useful.

Not too related, but just to share a bit of background, as I’ve seen some other posts with people interested on the same, we were using the App component provided in the UIKit, but query filtering was not enabled there so we made our own interface using the other UIKit Components that are more customisable.

Being able to pass down the query props from App to the internal ChannelList would have been a great feature in this case, just sharing the feedback in case it’s useful to you and the Engineering team :slight_smile: .

Hi @josebra,

I very much appreciate that feedback. I’ll make sure to pass it on to our Product Management team.