Adding the ability to disable full text search queries for master (#6102)

Этот коммит содержится в:
Corey Hulen
2017-04-17 07:54:26 -07:00
коммит произвёл Christopher Speller
родитель 7e29dc65aa
Коммит 3207886514
5 изменённых файлов: 33 добавлений и 0 удалений

Просмотреть файл

@@ -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
}