Browse Source

feat: order search results by views

main
Inhji Y. 4 months ago
parent
commit
71f710f9ce
  1. 3
      lib/mirage/notes.ex

3
lib/mirage/notes.ex

@ -30,7 +30,8 @@ defmodule Mirage.Notes do
select: n,
preload: ^@note_preloads,
where: contains(n.content, ^query),
or_where: contains(n.title, ^query)
or_where: contains(n.title, ^query),
order_by: [:views]
Repo.all(q)
end

Loading…
Cancel
Save