1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-04-01 21:04:25 +02:00

GH-3564: Change boards search to "all" words ()

* make search on words 'and'

* update search in auth layer
This commit is contained in:
Scott Bishel 2022-08-10 03:19:30 -06:00 committed by GitHub
parent c28620594a
commit 3b099bada4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions
server/services/store
mattermostauthlayer
sqlstore

@ -585,12 +585,12 @@ func (s *MattermostAuthLayer) SearchBoardsForUser(term, userID string) ([]*model
if term != "" {
// break search query into space separated words
// and search for each word.
// and search for all words.
// This should later be upgraded to industrial-strength
// word tokenizer, that uses much more than space
// to break words.
conditions := sq.Or{}
conditions := sq.And{}
for _, word := range strings.Split(strings.TrimSpace(term), " ") {
conditions = append(conditions, sq.Like{"lower(b.title)": "%" + strings.ToLower(word) + "%"})

@ -660,12 +660,12 @@ func (s *SQLStore) searchBoardsForUser(db sq.BaseRunner, term, userID string) ([
if term != "" {
// break search query into space separated words
// and search for each word.
// and search for all words.
// This should later be upgraded to industrial-strength
// word tokenizer, that uses much more than space
// to break words.
conditions := sq.Or{}
conditions := sq.And{}
for _, word := range strings.Split(strings.TrimSpace(term), " ") {
conditions = append(conditions, sq.Like{"lower(b.title)": "%" + strings.ToLower(word) + "%"})
@ -706,12 +706,12 @@ func (s *SQLStore) searchBoardsForUserInTeam(db sq.BaseRunner, teamID, term, use
if term != "" {
// break search query into space separated words
// and search for each word.
// and search for all words.
// This should later be upgraded to industrial-strength
// word tokenizer, that uses much more than space
// to break words.
conditions := sq.Or{}
conditions := sq.And{}
for _, word := range strings.Split(strings.TrimSpace(term), " ") {
conditions = append(conditions, sq.Like{"lower(b.title)": "%" + strings.ToLower(word) + "%"})