'Return a list of subreddits that are relevant to a search query.'

@require_oauth2_scope('read')
@json_validate(query=VLength('query', max_length=50))
@api_doc(api_section.subreddits)
def GET_subreddits_by_topic(self, responder, query):

    if (not g.CLOUDSEARCH_SEARCH_API):
        return []
    query = (query and query.strip())
    if ((not query) or (len(query) < 2)):
        return []
    common_english_words = {'the', 'be', 'to', 'of', 'and', 'in', 'that', 'have', 'it', 'for', 'not', 'on', 'with', 'he', 'as', 'you', 'do', 'at', 'this', 'but', 'his', 'by', 'from', 'they', 'we', 'say', 'her', 'she', 'or', 'an', 'will', 'my', 'one', 'all', 'would', 'there', 'their', 'what', 'so', 'up', 'out', 'if', 'about', 'who', 'get', 'which', 'go', 'me', 'when', 'make', 'can', 'like', 'time', 'no', 'just', 'him', 'know', 'take', 'people', 'into', 'year', 'your', 'good', 'some', 'could', 'them', 'see', 'other', 'than', 'then', 'now', 'look', 'only', 'come', 'its', 'over', 'think', 'also', 'back', 'after', 'use', 'two', 'how', 'our', 'work', 'first', 'well', 'way', 'even', 'new', 'want', 'because', 'any', 'these', 'give', 'day', 'most', 'us'}
    if (query.lower() in common_english_words):
        return []
    exclude = Subreddit.default_subreddits()
    faceting = {'reddit': {'sort': '-sum(text_relevance)', 'count': 20}}
    try:
        results = g.search.SearchQuery(query, sort='relevance', faceting=faceting, num=0, syntax='plain').run()
    except g.search.SearchException:
        abort(500)
    sr_results = []
    for (sr, count) in results.subreddit_facets:
        if ((sr._id in exclude) or (sr.over_18 and (not c.over18)) or (sr.type == 'archived')):
            continue
        sr_results.append({'name': sr.name})
    return sr_results
