photoprism/pkg/txt/search.go
Michael Mayer 24eff21aa4 Search: Default to photo names and keywords #1517 #1560
Default to photo name when search term is too short or on the stop list.
Search full text index otherwise, which now include names of people
(requires reindexing).
2021-09-29 20:09:34 +02:00

17 lines
262 B
Go

package txt
// SearchTerms returns a bool map with all terms as key.
func SearchTerms(s string) map[string]bool {
result := make(map[string]bool)
if s == "" {
return result
}
for _, w := range UniqueKeywords(s) {
result[w] = true
}
return result
}