app/Services/SearchService.php
private function rowLimiter(int $limit = 1000): Closure
    {
        return static function () use ($limit): void {
            static $n = 0;

            if (++$n > $limit) {
                $message = I18N::translate('The search returned too many results.');

                throw new InternalServerErrorException($message);
            }
        };
    }
private function rowLimiter(int $limit = 1000): Closure
    {
        return static function () use ($limit): void {
            static $n = 0;

            if (++$n > $limit) {
                $message = I18N::translate('The search returned too many results.');

                throw new InternalServerErrorException($message);
            }
        };
    }
private function rowLimiter ( int $ limit = 1000 ) : Closure { return static function ( ) use ( $ limit ) : void { static $ n = 0 ; if ( ++ $ n > $ limit ) { $ message = I18N :: translate ( 'The search returned too many results.' ) ; throw new InternalServerErrorException ( $ message ) ; } } ; }
Searching for short or common text can give more results than the system can process.

@param int $limit

@return Closure
Searching for short or common text can give more results than the system can process .