diff --git a/lib/philomena/comments/query.ex b/lib/philomena/comments/query.ex index 332ff199..4a3ace7f 100644 --- a/lib/philomena/comments/query.ex +++ b/lib/philomena/comments/query.ex @@ -26,10 +26,16 @@ defmodule Philomena.Comments.Query do :ok, %{ bool: %{ - must: %{term: %{anonymous: false}}, - should: [ - %{wildcard: %{author: data}}, - %{term: %{author: data}} + must: [ + %{term: %{anonymous: false}}, + %{ + bool: %{ + should: [ + %{term: %{author: data}}, + %{wildcard: %{author: data}} + ] + } + } ] } } diff --git a/lib/philomena/posts/query.ex b/lib/philomena/posts/query.ex index 7efb440f..bca23c4c 100644 --- a/lib/philomena/posts/query.ex +++ b/lib/philomena/posts/query.ex @@ -26,10 +26,16 @@ defmodule Philomena.Posts.Query do :ok, %{ bool: %{ - must: %{term: %{anonymous: false}}, - should: [ - %{wildcard: %{author: data}}, - %{term: %{author: data}} + must: [ + %{term: %{anonymous: false}}, + %{ + bool: %{ + should: [ + %{term: %{author: String.downcase(data)}}, + %{wildcard: %{author: String.downcase(data)}} + ] + } + } ] } }