more careful gallery search

This commit is contained in:
byte[] 2019-12-16 01:07:10 -05:00
parent 3012de58b6
commit c70e2e48d1

View file

@ -127,7 +127,7 @@ defmodule PhilomenaWeb.GalleryController do
defp parse_included_image(%{"include_image" => image_id}) when is_binary(image_id) and image_id not in [nil, ""] do
with {image_id, _rest} <- Integer.parse(image_id) do
[%{term: %{image_id: image_id}}]
[%{term: %{image_ids: image_id}}]
else
_ ->
[]
@ -136,7 +136,7 @@ defmodule PhilomenaWeb.GalleryController do
defp parse_included_image(_params), do: []
defp parse_description(%{"description" => description}) when is_binary(description) and description not in [nil, ""],
do: [%{match: %{description: %{query: description, operator: :and}}}]
do: [%{match_phrase: %{description: description}}]
defp parse_description(_params), do: []
defp parse_sort(%{"gallery" => %{"sf" => sf, "sd" => sd}})
@ -151,4 +151,4 @@ defmodule PhilomenaWeb.GalleryController do
defp position_order(%{order_position_asc: true}), do: "asc"
defp position_order(_gallery), do: "desc"
end
end