How to use Elixir function in ecto query

Hi @shakram02

This not possible.

Am not sure what those conditions are but I would suggest using and or or to join those conditions. ie

 from v in query,
          join: vs in assoc(v, :visitor),
          join: vc in assoc(v, :visitor_company),
          join: h in assoc(v, :host),
          where:
            ilike(vs.first_name, ^"%#{term}%") or
              ilike(vs.second_name, ^"%#{term}%") or
              ilike(vs.email, ^"%#{term}%") or
              ilike(vs.phone, ^"%#{term}%") or
              ilike(h.first_name, ^"%#{term}%") or
              ilike(vc.name, ^"%#{term}%")

Hope that helps.