-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make search use fulltext search #4
Comments
http://docs.sqlalchemy.org/en/rel_1_0/dialects/postgresql.html#full-text-search I can't really make sense of how to translate this to the ORM though. There's also a package: https://sqlalchemy-searchable.readthedocs.org/en/latest/ |
Apparently to sort by relevance with a fulltext search in psql you need to do this, which I have no idea how to do in SQLAlchemy. SELECT ts_rank_cd(
to_tsvector('english', table.column),
to_tsquery('search string')
) AS score |
Ty for the highlight @rgarnier
|
@x89 fix |
Got me a working query select id, body, ts_rank_cd(to_tsvector('english', body), query) as score
from quotes, to_tsquery('linux') query
where query @@ to_tsvector('english', body)
order by score desc; Doing the |
just use microsoft sql server |
Nice haircut @anlutro |
So that we can sort by match score etc.
The text was updated successfully, but these errors were encountered: