mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 21:17:37 +03:00
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:
parent
aae9d89e8c
commit
76e522710a
3 changed files with 21 additions and 12 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue