Skip to content

Commit

Permalink
Update search query to match name and symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
sgobotta committed Dec 2, 2023
1 parent 3d444ce commit 0d079fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ex_finance/instruments.ex
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ defmodule ExFinance.Instruments do

Cedear
|> order_by(asc: :symbol)
|> where([c], ilike(c.name, ^search_query))
|> where(
[c],
ilike(c.name, ^search_query) or ilike(c.symbol, ^search_query)
)
|> limit(5)
|> Repo.all()
end
Expand Down

0 comments on commit 0d079fa

Please sign in to comment.