svyLookup with custom sort
Posted: Mon May 13, 2024 7:09 pm
Hi all,
I use svyLookup and I would like to sort the results using custom PostgreSQL functionality.
if the words are similar, I want to order by the levenshtein distance between the words.
Is there any way to use a custom sort like this with svyLookup?
I use svyLookup and I would like to sort the results using custom PostgreSQL functionality.
- Code: Select all
ORDER BY CASE WHEN dmetaphone(company_name) = dmetaphone(?) THEN levenshtein(company_name,?) ELSE 0 END,company_name
if the words are similar, I want to order by the levenshtein distance between the words.
Is there any way to use a custom sort like this with svyLookup?