Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
mattermost-server
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
2
Merge Requests
2
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
sysadmin
mattermost
mattermost-server
Commits
45464234
Commit
45464234
authored
Sep 27, 2018
by
Christopher Speller
Committed by
Harrison Healey
Sep 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing non elastic search paging. (#9471)
parent
15d9f10f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
api4/post_test.go
api4/post_test.go
+14
-0
app/post.go
app/post.go
+5
-0
No files found.
api4/post_test.go
View file @
45464234
...
...
@@ -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
{
...
...
app/post.go
View file @
45464234
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment