Ash FrameworkAF
Ash Framework3y ago
8 replies
djacobs7

How can I do a 'like' query or similarity search?

Hi,

I am looking to do fuzzy search. So, for example , if the user types in 'dan'. I'd like to return all users whose names or emails include 'dan'. I read through the predicate list here: https://hexdocs.pm/ash/Ash.Filter.html hoping for something like 'like' in SQL, but I didnt see naything. What is the best approach?

Here is how my code looks currently:

App.EmailHandler.User
|> Ash.Query.filter(
[or: [
[email: search_slug],
[name: search_slug]
]])
Was this page helpful?