synapse/storage/search.py
def _parse_query(database_engine, search_term):
    """Takes a plain unicode string from the user and converts it into a form
    that can be passed to database.
    We use this so that we can add prefix matching, which isn't something
    that is supported by default.
    """

    # Pull out the individual words, discarding any non-word characters.
    results = re.findall(r"([\w\-]+)", search_term, re.UNICODE)

    if isinstance(database_engine, PostgresEngine):
        return " & ".join(result + ":*" for result in results)
    elif isinstance(database_engine, Sqlite3Engine):
        return " & ".join(result + "*" for result in results)
    else:
        # This should be unreachable.
        raise Exception("Unrecognized database engine")
Takes a plain unicode string from the user and converts it into a form
    that can be passed to database.
    We use this so that we can add prefix matching, which isn't something
    that is supported by default.
    
Takes a plain unicode string from the user and converts it into a form
that can be passed to database.
We use this so that we can add prefix matching, which isn't something
that is supported by default.
Takes a plain unicode string from the user and converts it into a form that can be passed to database . We use this so that we can add prefix matching which isn ' t something that is supported by default .
def _parse_query(database_engine, search_term):
    results = re.findall(r"([\w\-]+)", search_term, re.UNICODE)
    if isinstance(database_engine, PostgresEngine):
        return " & ".join(result + ":*" for result in results)
    elif isinstance(database_engine, Sqlite3Engine):
        return " & ".join(result + "*" for result in results)
    else:
        raise Exception("Unrecognized database engine")
def _parse_query ( database_engine , search_term ) : results = re . findall ( r"([\w\-]+)" , search_term , re . UNICODE ) if isinstance ( database_engine , PostgresEngine ) : return " & " . join ( result + ":*" for result in results ) elif isinstance ( database_engine , Sqlite3Engine ) : return " & " . join ( result + "*" for result in results ) else : raise Exception ( "Unrecognized database engine" )
Takes a plain unicode string from the user and converts it into a form
that can be passed to database.
Takes a plain unicode string from the user and converts it into a form that can be passed to database .
"""Takes a plain unicode string from the user and converts it into a form
    that can be passed to database.
    We use this so that we can add prefix matching, which isn't something
    that is supported by default.
    """ # Pull out the individual words, discarding any non-word characters. # This should be unreachable.
database_engine
search_term