'Search subreddits by title and description.'

@base_listing
@require_oauth2_scope('read')
@validate(query=nop('q', docs={'q': 'a    search    query'}), sort=VMenu('sort', SubredditSearchSortMenu, remember=False))
@api_doc(api_section.subreddits, uri='/subreddits/search', supports_rss=True)
def GET_search_reddits(self, query, reverse, after, count, num, sort):

    if (request.GET.get('over18') == 'yes'):
        u = UrlParser(request.fullurl)
        del u.query_dict['over18']
        search_url = u.unparse()
        return self.intermediate_redirect('/over18', sr_path=False, fullpath=search_url)
    is_api_or_rss = ((c.render_style in API_TYPES) or (c.render_style in RSS_TYPES))
    if is_api_or_rss:
        include_over18 = ((not c.obey_over18) or c.over18)
    elif feature.is_enabled('safe_search'):
        include_over18 = c.over18
    else:
        include_over18 = True
    if query:
        q = g.search.SubredditSearchQuery(query, sort=sort, faceting={}, include_over18=include_over18)
        content = self._search(q, num=num, reverse=reverse, after=after, count=count, skip_deleted_authors=False)
    else:
        content = None
    event_target = {}
    if after:
        event_target['target_count'] = count
        if reverse:
            event_target['target_before'] = after._fullname
        else:
            event_target['target_after'] = after._fullname
    extra_js_config = {'event_target': event_target}
    res = SubredditsPage(content=content, prev_search=query, page_classes=['subreddits-page'], extra_js_config=extra_js_config, search_params={}, title=_('search    results'), simple=True).render()
    return res
