[backend/core] Fix negated search parameters when match:words is used
This commit is contained in:
parent
af750a010d
commit
37fc124b08
1 changed files with 24 additions and 24 deletions
|
@ -274,34 +274,34 @@ public static class QueryableFtsExtensions
|
|||
) => matchType.Equals(MatchFilterType.Substring)
|
||||
? caseSensitivity.Equals(CaseFilterType.Sensitive)
|
||||
? negated
|
||||
? !EF.Functions.Like(note.Text!, "%" + query + "%", @"\")
|
||||
&& !EF.Functions.Like(note.Cw!, "%" + query + "%", @"\")
|
||||
&& !EF.Functions.Like(note.CombinedAltText!, "%" + query + "%", @"\")
|
||||
: EF.Functions.Like(note.Text!, "%" + query + "%", @"\")
|
||||
|| EF.Functions.Like(note.Cw!, "%" + query + "%", @"\")
|
||||
|| EF.Functions.Like(note.CombinedAltText!, "%" + query + "%", @"\")
|
||||
? !EF.Functions.Like(note.Text ?? "", "%" + query + "%", @"\")
|
||||
&& !EF.Functions.Like(note.Cw ?? "", "%" + query + "%", @"\")
|
||||
&& !EF.Functions.Like(note.CombinedAltText ?? "", "%" + query + "%", @"\")
|
||||
: EF.Functions.Like(note.Text ?? "", "%" + query + "%", @"\")
|
||||
|| EF.Functions.Like(note.Cw ?? "", "%" + query + "%", @"\")
|
||||
|| EF.Functions.Like(note.CombinedAltText ?? "", "%" + query + "%", @"\")
|
||||
: negated
|
||||
? !EF.Functions.ILike(note.Text!, "%" + query + "%", @"\")
|
||||
&& !EF.Functions.ILike(note.Cw!, "%" + query + "%", @"\")
|
||||
&& !EF.Functions.ILike(note.CombinedAltText!, "%" + query + "%", @"\")
|
||||
: EF.Functions.ILike(note.Text!, "%" + query + "%", @"\")
|
||||
|| EF.Functions.ILike(note.Cw!, "%" + query + "%", @"\")
|
||||
|| EF.Functions.ILike(note.CombinedAltText!, "%" + query + "%", @"\")
|
||||
? !EF.Functions.ILike(note.Text ?? "", "%" + query + "%", @"\")
|
||||
&& !EF.Functions.ILike(note.Cw ?? "", "%" + query + "%", @"\")
|
||||
&& !EF.Functions.ILike(note.CombinedAltText ?? "", "%" + query + "%", @"\")
|
||||
: EF.Functions.ILike(note.Text ?? "", "%" + query + "%", @"\")
|
||||
|| EF.Functions.ILike(note.Cw ?? "", "%" + query + "%", @"\")
|
||||
|| EF.Functions.ILike(note.CombinedAltText ?? "", "%" + query + "%", @"\")
|
||||
: caseSensitivity.Equals(CaseFilterType.Sensitive)
|
||||
? negated
|
||||
? !Regex.IsMatch(note.Text!, "\\y" + query + "\\y")
|
||||
&& !Regex.IsMatch(note.Cw!, "\\y" + query + "\\y")
|
||||
&& !Regex.IsMatch(note.CombinedAltText!, "\\y" + query + "\\y")
|
||||
: Regex.IsMatch(note.Text!, "\\y" + query + "\\y")
|
||||
|| Regex.IsMatch(note.Cw!, "\\y" + query + "\\y")
|
||||
|| Regex.IsMatch(note.CombinedAltText!, "\\y" + query + "\\y")
|
||||
? !Regex.IsMatch(note.Text ?? "", "\\y" + query + "\\y")
|
||||
&& !Regex.IsMatch(note.Cw ?? "", "\\y" + query + "\\y")
|
||||
&& !Regex.IsMatch(note.CombinedAltText ?? "", "\\y" + query + "\\y")
|
||||
: Regex.IsMatch(note.Text ?? "", "\\y" + query + "\\y")
|
||||
|| Regex.IsMatch(note.Cw ?? "", "\\y" + query + "\\y")
|
||||
|| Regex.IsMatch(note.CombinedAltText ?? "", "\\y" + query + "\\y")
|
||||
: negated
|
||||
? !Regex.IsMatch(note.Text!, "\\y" + query + "\\y", RegexOptions.IgnoreCase)
|
||||
&& !Regex.IsMatch(note.Cw!, "\\y" + query + "\\y", RegexOptions.IgnoreCase)
|
||||
&& !Regex.IsMatch(note.CombinedAltText!, "\\y" + query + "\\y", RegexOptions.IgnoreCase)
|
||||
: Regex.IsMatch(note.Text!, "\\y" + query + "\\y", RegexOptions.IgnoreCase)
|
||||
|| Regex.IsMatch(note.Cw!, "\\y" + query + "\\y", RegexOptions.IgnoreCase)
|
||||
|| Regex.IsMatch(note.CombinedAltText!, "\\y" + query + "\\y", RegexOptions.IgnoreCase);
|
||||
? !Regex.IsMatch(note.Text ?? "", "\\y" + query + "\\y", RegexOptions.IgnoreCase)
|
||||
&& !Regex.IsMatch(note.Cw ?? "", "\\y" + query + "\\y", RegexOptions.IgnoreCase)
|
||||
&& !Regex.IsMatch(note.CombinedAltText ?? "", "\\y" + query + "\\y", RegexOptions.IgnoreCase)
|
||||
: Regex.IsMatch(note.Text ?? "", "\\y" + query + "\\y", RegexOptions.IgnoreCase)
|
||||
|| Regex.IsMatch(note.Cw ?? "", "\\y" + query + "\\y", RegexOptions.IgnoreCase)
|
||||
|| Regex.IsMatch(note.CombinedAltText ?? "", "\\y" + query + "\\y", RegexOptions.IgnoreCase);
|
||||
|
||||
[Projectable]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global",
|
||||
|
|
Loading…
Add table
Reference in a new issue