From 4a6b0baacfd06f3fc894eccd76610a5c21283446 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 6 Sep 2021 15:54:38 +0200 Subject: [PATCH] Search: Add "with" as an alias for "and" #22 --- internal/query/like.go | 1 + internal/query/query.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/query/like.go b/internal/query/like.go index 5ca4f5c65..42823b3c6 100644 --- a/internal/query/like.go +++ b/internal/query/like.go @@ -15,6 +15,7 @@ func NormalizeSearchQuery(s string) string { s = strings.ToLower(txt.Clip(s, txt.ClipQuery)) s = strings.ReplaceAll(s, OrEn, Or) s = strings.ReplaceAll(s, AndEn, And) + s = strings.ReplaceAll(s, WithEn, And) s = strings.ReplaceAll(s, Plus, And) s = strings.ReplaceAll(s, "%", "*") return strings.Trim(s, "+&|_-=!@$%^(){}\\<>,.;: ") diff --git a/internal/query/query.go b/internal/query/query.go index 029d1236b..924cbab9d 100644 --- a/internal/query/query.go +++ b/internal/query/query.go @@ -47,6 +47,7 @@ const ( Plus = " + " OrEn = " or " AndEn = " and " + WithEn = " with " Space = " " Empty = "" )