Commit 45464234 authored by Christopher Speller's avatar Christopher Speller Committed by Harrison Healey

Fixing non elastic search paging. (#9471)

parent 15d9f10f
......@@ -1343,6 +1343,20 @@ func TestSearchPosts(t *testing.T) {
assert.Equal(t, posts.Order[0], posts2.Order[0])
assert.Equal(t, posts.Order[1], posts2.Order[1])
page = 1
searchParams = model.SearchParameter{
Terms: &terms,
IsOrSearch: &isOrSearch,
TimeZoneOffset: &timezoneOffset,
Page: &page,
PerPage: &perPage,
}
posts2, resp = Client.SearchPostsWithParams(th.BasicTeam.Id, &searchParams)
CheckNoError(t, resp)
if len(posts2.Order) != 0 { // We don't support paging for DB search yet, modify this when we do.
t.Fatal("Wrong number of posts", len(posts2.Order))
}
posts, resp = Client.SearchPosts(th.BasicTeam.Id, "search", false)
CheckNoError(t, resp)
if len(posts.Order) != 3 {
......
......@@ -726,6 +726,11 @@ func (a *App) SearchPostsInTeam(terms string, userId string, teamId string, isOr
return nil, model.NewAppError("SearchPostsInTeam", "store.sql_post.search.disabled", nil, fmt.Sprintf("teamId=%v userId=%v", teamId, userId), http.StatusNotImplemented)
}
// Since we don't support paging we just return nothing for later pages
if page > 0 {
return model.MakePostSearchResults(model.NewPostList(), nil), nil
}
channels := []store.StoreChannel{}
for _, params := range paramsList {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment