From f47e9f5e05b049ee498e2882eb8ffb66a21343e0 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Wed, 22 Jan 2020 09:01:10 -0500 Subject: [PATCH] fix apparent author query --- lib/philomena/comments/query.ex | 7 ++++--- lib/philomena/posts/query.ex | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/philomena/comments/query.ex b/lib/philomena/comments/query.ex index ca9f8797..332ff199 100644 --- a/lib/philomena/comments/query.ex +++ b/lib/philomena/comments/query.ex @@ -26,9 +26,10 @@ defmodule Philomena.Comments.Query do :ok, %{ bool: %{ - must: [ - %{term: %{anonymous: false}}, - %{wildcard: %{author: data}} + must: %{term: %{anonymous: false}}, + should: [ + %{wildcard: %{author: data}}, + %{term: %{author: data}} ] } } diff --git a/lib/philomena/posts/query.ex b/lib/philomena/posts/query.ex index 6fb1a365..7efb440f 100644 --- a/lib/philomena/posts/query.ex +++ b/lib/philomena/posts/query.ex @@ -26,9 +26,10 @@ defmodule Philomena.Posts.Query do :ok, %{ bool: %{ - must: [ - %{term: %{anonymous: false}}, - %{wildcard: %{author: data}} + must: %{term: %{anonymous: false}}, + should: [ + %{wildcard: %{author: data}}, + %{term: %{author: data}} ] } }