From 0ab7e860c62b59160e78c4cc87d82ed1dc7bbf1d Mon Sep 17 00:00:00 2001 From: Charlie Holtz Date: Wed, 27 Sep 2023 16:16:25 -0400 Subject: [PATCH] num results == 21 --- lib/emoji_web/live/search_live.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/emoji_web/live/search_live.ex b/lib/emoji_web/live/search_live.ex index e6a5dbb..50646e0 100644 --- a/lib/emoji_web/live/search_live.ex +++ b/lib/emoji_web/live/search_live.ex @@ -1,6 +1,8 @@ defmodule EmojiWeb.SearchLive do use EmojiWeb, :live_view + @num_results 21 + @impl true def mount(_params, _session, socket) do {:ok, @@ -27,7 +29,7 @@ defmodule EmojiWeb.SearchLive do @impl true def handle_params(%{"q" => query}, _uri, socket) do - Task.async(fn -> Emoji.Embeddings.search_emojis(query, 3, false) end) + Task.async(fn -> Emoji.Embeddings.search_emojis(query, @num_results, false) end) {:noreply, socket @@ -39,7 +41,9 @@ defmodule EmojiWeb.SearchLive do @impl true def handle_params(%{"q" => query, "search_via_images" => search_via_images}, _uri, socket) do - Task.async(fn -> Emoji.Embeddings.search_emojis(query, 3, search_via_images == "true") end) + Task.async(fn -> + Emoji.Embeddings.search_emojis(query, @num_results, search_via_images == "true") + end) {:noreply, socket