@classmethod<EOL><INDENT>def search(cls, search_string, values_of='<STR_LIT>', group=whoosh.qparser.OrGroup, match_substrings=True, limit=None):<DEDENT>
index = Whooshee.get_or_create_index(_get_app(cls), cls)<EOL>prepped_string = cls.prep_search_string(search_string, match_substrings)<EOL>with index.searcher() as searcher:<EOL><INDENT>parser = whoosh.qparser.MultifieldParser(cls.schema.names(), index.schema, group=group)<EOL>query = parser.parse(prepped_string)<EOL>results = searcher.search(query, limit=limit)<EOL>if values_of:<EOL><INDENT>return [x[values_of] for x in results]<EOL><DEDENT>return results<EOL><DEDENT>
Searches the fields for given search_string.
        Returns the found records if 'values_of' is left empty,
        else the values of the given columns.

        :param search_string: The string to search for.
        :param values_of: If given, the method will not return the whole
                          records, but only values of given column.
                          Defaults to returning whole records.
        :param group: The whoosh group to use for searching.
                      Defaults to :class:`whoosh.qparser.OrGroup` which
                      searches for all words in all columns.
        :param match_substrings: ``True`` if you want to match substrings,
                                 ``False`` otherwise.
        :param limit: The number of the top records to be returned.
                      Defaults to ``None`` and returns all records.