From 0d079fa0b94d875898ba27267be9be06fa17a7c6 Mon Sep 17 00:00:00 2001 From: Santiago Botta Date: Fri, 1 Dec 2023 23:08:49 -0300 Subject: [PATCH] Update search query to match name and symbol --- lib/ex_finance/instruments.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ex_finance/instruments.ex b/lib/ex_finance/instruments.ex index 1dd1c9f..44aaccc 100644 --- a/lib/ex_finance/instruments.ex +++ b/lib/ex_finance/instruments.ex @@ -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