Search Communities displayName 500000 ASC error

In my React Native app, I’m currently trying to add a search bar for my app’s communities. This is the relevant code for that.

export const useCommunities = ({
  membership,
  categoryId,
  includeDeleted,
  tags,
  sortBy,
  trending,
  limit = 10,
  restrictToLimit,
  searchTerm,
  stopInitialLoadingFlag,
  refreshDependencies = []
}: useCommunitiesProps)
/// OTHER CODE

const [debouncedSearchTerm, setDebouncedSearchTerm] = useState<
    string | undefined
  >();

////// OTHER CODE
const handleSearchChange = useMemo(
    () =>
      _.debounce((text) => {
        setDebouncedSearchTerm(text);
      }, 500),
    []
  );
/// OTHER CODE
CommunityRepository.searchCommunities(
            {
              membership,
              categoryId,
              includeDeleted,
              tags,
              sortBy,
              limit,
              displayName: debouncedSearchTerm
            },
            communitiesCallback
          );
//// OTHER CODE
useEffect(() => {
    handleSearchChange(searchTerm);

    return () => {
      handleSearchChange.cancel();
    };
  }, [searchTerm]);

whenever debouncedSearchTerm changes to some actual string, for example
{“debouncedSearchTerm”: “C-”}

I get the error:

{
“code”: 500000,
“level”: “error”,
“type”: “ASC”,
“timestamp”: 1755785148417
}

from searchCommunities

Hello @awareai-dev , Regarding the error you encountered when calling CommunityRepository.searchCommunities, please double-check the parameters being passed into the function. If any parameter (for example, categoryId) is undefined, it may trigger the error 500000 – Parameters validation error.

We tested with the following example and it worked as expected:

const unsubscribe = CommunityRepository.searchCommunities(
  { 
    membership: 'all', 
    limit: 20, 
    displayName: 'C-', 
    sortBy: 'displayName', 
    categoryId: 'f1fbdb0fb1615031306eeeeaa170cc4d' 
  },
  (data) => {
    console.log('data: ', data);
  }
);

I see. The highest limit is 99. Is this documented anywhere?

Hello @awareai-dev , You are correct that the current maximum limit is 99. We sincerely apologize that this has not been clearly documented. We will share this feedback with our team to ensure the documentation is improved accordingly.