Adding paging to elasticsearch API. (#9425)

Этот коммит содержится в:
Christopher Speller
2018-09-26 07:27:04 -07:00
коммит произвёл Harrison Healey
родитель bfec808e53
Коммит 37e00ef916
6 изменённых файлов: 68 добавлений и 32 удалений

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

@@ -622,7 +622,7 @@ func (a *App) DeletePostFiles(post *model.Post) {
}
}
func (a *App) SearchPostsInTeam(terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int) (*model.PostSearchResults, *model.AppError) {
func (a *App) SearchPostsInTeam(terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.PostSearchResults, *model.AppError) {
paramsList := model.ParseSearchParams(terms, timeZoneOffset)
includeDeleted := includeDeletedChannels && *a.Config().TeamSettings.ExperimentalViewArchivedChannels
@@ -668,7 +668,7 @@ func (a *App) SearchPostsInTeam(terms string, userId string, teamId string, isOr
return nil, err
}
postIds, matches, err := a.Elasticsearch.SearchPosts(userChannels, finalParamsList)
postIds, matches, err := a.Elasticsearch.SearchPosts(userChannels, finalParamsList, page, perPage)
if err != nil {
return nil, err
}