Search Channels by displayName

Search- Search result does not appear if user searches apart from the first word in the user or channel name.
Ex- If user name is “John Doe”, then if we search Doe then result does not appear.

  const onQueryChannel = useCallback(
    async (query: string | undefined = undefined, isDirectChannel = false) => {
      setState(prev => ({...prev, isSearching: true, isLoading: true}));
      try {
        let displayName = query;
        if (isDirectChannel && query) {
          displayName = `${session_info.name}:${query}`;
        }

        const data = ChannelRepository.getChannels(
          {
            sortBy: 'lastActivity',
            limit: 40,
            membership: membership,
            isDeleted: false,
            tags: filterTags,
            excludeTags: [...getEnvChannelExcludeTags()],
            displayName: displayName,
            types: isDirectChannel
              ? ['conversation']
              : ['community', 'broadcast', 'live'],
          },
          value => setChannels(value, isDirectChannel),
        );

        if (data) {
          disposers.current.push(data);
        }
      } catch (error) {
        setChannels([], isDirectChannel);
      }
    },
    [filterTags, membership, setChannels, session_info],
  );

Hello @devS, just to clarify, are you referring specifically to conversation channels where the user’s display name appears as the channel’s display name? Or does this apply to other channel types with a display name as well?

I am trying to search channels by their display name.

Hello @devS, this is our current design for the channel display name search, We’ll forward your feedback to our team for potential future improvements.