synapse/storage/user_directory.py
def _parse_query_postgres(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)

    both = " & ".join("(%s:* | %s)" % (result, result,) for result in results)
    exact = " & ".join("%s" % (result,) for result in results)
    prefix = " & ".join("%s:*" % (result,) for result in results)

    return both, exact, prefix
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_postgres(search_term):
    results = re.findall(r"([\w\-]+)", search_term, re.UNICODE)
    both = " & ".join("(%s:* | %s)" % (result, result,) for result in results)
    exact = " & ".join("%s" % (result,) for result in results)
    prefix = " & ".join("%s:*" % (result,) for result in results)
    return both, exact, prefix
def _parse_query_postgres ( search_term ) : results = re . findall ( r"([\w\-]+)" , search_term , re . UNICODE ) both = " & " . join ( "(%s:* | %s)" % ( result , result , ) for result in results ) exact = " & " . join ( "%s" % ( result , ) for result in results ) prefix = " & " . join ( "%s:*" % ( result , ) for result in results ) return both , exact , prefix
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.
search_term