Implement search with PostgreSQL trigrams
Signed-off-by: Thomas Citharel <tcit@tcit.fr> Rename function to reflect that we only get one result Signed-off-by: Thomas Citharel <tcit@tcit.fr> Add loggers and make Ecto call parallels during search Signed-off-by: Thomas Citharel <tcit@tcit.fr> Implement trigrams for events & replace pg similarity operator % with <% Signed-off-by: Thomas Citharel <tcit@tcit.fr> Fix tests Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
13
lib/mobilizon_web/resolvers/search.ex
Normal file
13
lib/mobilizon_web/resolvers/search.ex
Normal file
@@ -0,0 +1,13 @@
|
||||
defmodule MobilizonWeb.Resolvers.Search do
|
||||
@moduledoc """
|
||||
Handles the event-related GraphQL calls
|
||||
"""
|
||||
alias MobilizonWeb.API.Search
|
||||
|
||||
@doc """
|
||||
Search events and actors by title
|
||||
"""
|
||||
def search_events_and_actors(_parent, %{search: search, page: page, limit: limit}, _resolution) do
|
||||
Search.search(search, page, limit)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user