Skip to content

Commit

Permalink
num results == 21
Browse files Browse the repository at this point in the history
  • Loading branch information
cbh123 committed Sep 27, 2023
1 parent d5d5228 commit 0ab7e86
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/emoji_web/live/search_live.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
defmodule EmojiWeb.SearchLive do
use EmojiWeb, :live_view

@num_results 21

@impl true
def mount(_params, _session, socket) do
{:ok,
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0ab7e86

Please sign in to comment.