def METHOD_NAME(self, w: str) -> SearchResult:
    if not self.ix.up_to_date():
        self.initialize_trie()  # if the index is not up to date, someone has added cards, so we reinitialize the trie
    normalized = list(WhooshConstants.normalized_analyzer(w))[0].text
    # If we get matches by prefix, we return that
    exact, prefix_whole_word, other_prefixed = self.find_matches_by_prefix(normalized)
    if exact or len(prefix_whole_word) > 0 or len(other_prefixed) > 0:
        return SearchResult(exact, prefix_whole_word, other_prefixed, [])
    # We try fuzzy and stemmed queries
    query_normalized = fuzzy_term(normalized, self.DIST, 'name_normalized')
    query_stemmed = And([Term('name_stemmed', q.text) for q in WhooshConstants.stem_analyzer(w)])
    query_tokenized = And([fuzzy_term(q.text, self.DIST, 'name_tokenized') for q in WhooshConstants.tokenized_analyzer(w)])
    if len(query_tokenized) == 0:  # This can be empty because some unicode chars are ignored. See #4988
        query = Or([query_normalized, query_stemmed])
    else:
        query = Or([query_normalized, query_tokenized, query_stemmed])
    with self.ix.searcher() as searcher:
        fuzzy = [(r['canonical_name'], r.score) for r in searcher.METHOD_NAME(query, limit=40)]
    return SearchResult(exact, prefix_whole_word, other_prefixed, fuzzy)