示例#1
0
def ts_match(field, query, regconfig='spanish'):
    return Expression(fn.to_tsvector(regconfig, field), OP.TS_MATCH, fn.plainto_tsquery(regconfig, query))
示例#2
0
def ts_rank(field, query, regconfig='spanish'):
    # return Expression(fn.to_tsvector(regconfig, field), OP.TS_MATCH, fn.plainto_tsquery(regconfig, query))
    return Expression(fn.ts_rank_cd(fn.to_tsvector(regconfig, field), fn.plainto_tsquery(regconfig, query)))