From 37e00ef916af9a5aeae760a01fa0a0cf8ca93637 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 26 Sep 2018 07:27:04 -0700 Subject: Adding paging to elasticsearch API. (#9425) --- app/post.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/post.go') diff --git a/app/post.go b/app/post.go index 9914f6db0..1daad6eea 100644 --- a/app/post.go +++ b/app/post.go @@ -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 } -- cgit v1.2.3-1-g7c22