summaryrefslogtreecommitdiffstats
path: root/store/sql_post_store.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2017-04-17 07:54:26 -0700
committerChristopher Speller <crspeller@gmail.com>2017-04-17 10:54:26 -0400
commit32078865147dc4779023e036aba164842067e58b (patch)
treed94cf763a265630ea0e963a0d847d6391627ed24 /store/sql_post_store.go
parent7e29dc65aaf5b310f1c1e3b8e8849103892e1ffe (diff)
downloadchat-32078865147dc4779023e036aba164842067e58b.tar.gz
chat-32078865147dc4779023e036aba164842067e58b.tar.bz2
chat-32078865147dc4779023e036aba164842067e58b.zip
Adding the ability to disable full text search queries for master (#6102)
Diffstat (limited to 'store/sql_post_store.go')
-rw-r--r--store/sql_post_store.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/store/sql_post_store.go b/store/sql_post_store.go
index 5d8a7cfdc..9d852abff 100644
--- a/store/sql_post_store.go
+++ b/store/sql_post_store.go
@@ -908,6 +908,17 @@ func (s SqlPostStore) Search(teamId string, userId string, params *model.SearchP
go func() {
result := StoreResult{}
+ if !*utils.Cfg.ServiceSettings.EnablePostSearch {
+ list := &model.PostList{}
+ list.MakeNonNil()
+ result.Data = list
+
+ result.Err = model.NewLocAppError("SqlPostStore.Search", "store.sql_post.search.disabled", nil, fmt.Sprintf("teamId=%v userId=%v params=%v", teamId, userId, params.ToJson()))
+ storeChannel <- result
+ close(storeChannel)
+ return
+ }
+
queryParams := map[string]interface{}{
"TeamId": teamId,
"UserId": userId,
@@ -919,6 +930,7 @@ func (s SqlPostStore) Search(teamId string, userId string, params *model.SearchP
if terms == "" && len(params.InChannels) == 0 && len(params.FromUsers) == 0 {
result.Data = []*model.Post{}
storeChannel <- result
+ close(storeChannel)
return
}