more comprehensive fix

This commit is contained in:
byte[] 2020-01-22 09:12:37 -05:00
parent f47e9f5e05
commit c2d26029ae
2 changed files with 20 additions and 8 deletions

View file

@ -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}}
]
}
}
]
}
}

View file

@ -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)}}
]
}
}
]
}
}