don't show hidden results

This commit is contained in:
byte[] 2019-10-06 17:45:26 -04:00
parent 02f30391f6
commit 68472cf412
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ defmodule PhilomenaWeb.ImageController do
images = images =
Image.search_records( Image.search_records(
%{ %{
query: %{bool: %{must_not: query}}, query: %{bool: %{must_not: [query, %{term: %{hidden_from_users: true}}]}},
sort: %{created_at: :desc} sort: %{created_at: :desc}
}, },
Image |> preload([:tags, :user]) Image |> preload([:tags, :user])

View file

@ -14,7 +14,7 @@ defmodule PhilomenaWeb.SearchController do
images = images =
Image.search_records( Image.search_records(
%{ %{
query: %{bool: %{must: query, must_not: filter}}, query: %{bool: %{must: query, must_not: [filter, %{term: %{hidden_from_users: true}}]}},
sort: %{created_at: :desc} sort: %{created_at: :desc}
}, },
Image |> preload(:tags) Image |> preload(:tags)