New option: SearchFullString, to match query strings anywhere in searchable fields, not only in word boundaries

Based on feedback from @orlea, in https://github.com/deluan/navidrome/issues/255#issuecomment-683427754
This commit is contained in:
Deluan 2020-08-30 13:08:10 -04:00
parent aae9d89e8c
commit 76e522710a
3 changed files with 21 additions and 12 deletions

View file

@ -62,11 +62,5 @@ func booleanFilter(field string, value interface{}) Sqlizer {
}
func fullTextFilter(field string, value interface{}) Sqlizer {
q := sanitizeStrings(value.(string))
parts := strings.Split(q, " ")
filters := And{}
for _, part := range parts {
filters = append(filters, Like{"full_text": "% " + part + "%"})
}
return filters
return fullTextExpr(value.(string))
}