SQLalchemy: sort a query by best match

Say I wanted to sort by the best match from a query. Like Ted being the query and the names on a table being Ted Cruz, Cruz Ted, Cr Ted Uz. This should return

  1. Ted Cruz
  2. Cr Ted Uz
  3. Cruz Ted

How would I go about achieving thin in SQL alchemy with a query object? Is there any way to do this?



Read more here: https://stackoverflow.com/questions/64950302/sqlalchemy-sort-a-query-by-best-match

Content Attribution

This content was originally published by i_r100 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: