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 (#3622)
* make search on words 'and' * update search in auth layer
This commit is contained in:
parent
c28620594a
commit
3b099bada4
server/services/store
@ -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) + "%"})
|
||||
|
Loading…
x
Reference in New Issue
Block a user