From 32078865147dc4779023e036aba164842067e58b Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Mon, 17 Apr 2017 07:54:26 -0700 Subject: Adding the ability to disable full text search queries for master (#6102) --- store/sql_post_store.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'store') 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 } -- cgit v1.2.3-1-g7c22