diff --git a/lib/users/users_queries.ex b/lib/users/users_queries.ex index b6885b8..5f6fe56 100644 --- a/lib/users/users_queries.ex +++ b/lib/users/users_queries.ex @@ -52,11 +52,22 @@ defmodule Bonfire.Me.Users.Queries do [profile: p, character: c], ilike(p.name, ^"#{text}%") or ilike(p.name, ^"% #{text}%") or + ilike(p.summary, ^"#{text}%") or + ilike(p.summary, ^"% #{text}%") or ilike(c.username, ^"#{text}%") or ilike(c.username, ^"% #{text}%") ) |> prepend_order_by([profile: p, character: c], [ - {:desc, fragment("(? <% ?)::int + (? <% ?)::int", ^text, c.username, ^text, p.name)} + {:desc, + fragment( + "(? <% ?)::int + (? <% ?)::int + (? <% ?)::int", + ^text, + c.username, + ^text, + p.name, + ^text, + p.summary + )} ]) end