Help with contains case insensitive Query

setonics
2023-03-14

setonics:

Hi I’m pretty new to elixir and ash. I’m trying to do a search by title. However I don’t know how to make it case insensitive. I saw the Ash contains functions but it uses Ash.CiString. And I’m not sure how to use it.

this is my code

read :by_title do

  argument :title, :string, allow_nil?: false
  filter expr(contains(title,^arg(:title)))
end

frankdugan3:

Welcome! 👋 All you need to do is replace :string with :ci_string . 🚀

setonics:

oh 👀 thanks

setonics:

worked perfectly, thanks alot <@433654314175692800>