From c70e2e48d1e9adc1d3f851636a65f2d2920b989f Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Mon, 16 Dec 2019 01:07:10 -0500 Subject: [PATCH] more careful gallery search --- lib/philomena_web/controllers/gallery_controller.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/philomena_web/controllers/gallery_controller.ex b/lib/philomena_web/controllers/gallery_controller.ex index a79c2ba4..b0852975 100644 --- a/lib/philomena_web/controllers/gallery_controller.ex +++ b/lib/philomena_web/controllers/gallery_controller.ex @@ -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 \ No newline at end of file +end