Search: Add "with" as an alias for "and" #22

This commit is contained in:
Michael Mayer 2021-09-06 15:54:38 +02:00
parent ed89552631
commit 4a6b0baacf
2 changed files with 2 additions and 0 deletions

View file

@ -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, "+&|_-=!@$%^(){}\\<>,.;: ")

View file

@ -47,6 +47,7 @@ const (
Plus = " + "
OrEn = " or "
AndEn = " and "
WithEn = " with "
Space = " "
Empty = ""
)