mirror of
https://github.com/nextcloud/server.git
synced 2026-04-24 15:53:36 -04:00
fix(file-search): use default limit to search query if not provided on request body
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
This commit is contained in:
parent
48339edf50
commit
607c78aa06
2 changed files with 7 additions and 6 deletions
|
|
@ -343,6 +343,7 @@ class FileSearchBackend implements ISearchBackend {
|
|||
}, $query->orderBy);
|
||||
|
||||
$limit = $query->limit;
|
||||
$maxResults = $limit->maxResults !== 0 ? (int)$limit->maxResults : 100;
|
||||
$offset = $limit->firstResult;
|
||||
|
||||
$limitHome = false;
|
||||
|
|
@ -370,7 +371,7 @@ class FileSearchBackend implements ISearchBackend {
|
|||
|
||||
return new SearchQuery(
|
||||
$operators,
|
||||
(int)$limit->maxResults,
|
||||
$maxResults,
|
||||
$offset,
|
||||
$orders,
|
||||
$this->user,
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class FileSearchBackendTest extends TestCase {
|
|||
'name',
|
||||
'foo'
|
||||
),
|
||||
0,
|
||||
100,
|
||||
0,
|
||||
[],
|
||||
$this->user
|
||||
|
|
@ -126,7 +126,7 @@ class FileSearchBackendTest extends TestCase {
|
|||
'mimetype',
|
||||
'foo'
|
||||
),
|
||||
0,
|
||||
100,
|
||||
0,
|
||||
[],
|
||||
$this->user
|
||||
|
|
@ -155,7 +155,7 @@ class FileSearchBackendTest extends TestCase {
|
|||
'size',
|
||||
10
|
||||
),
|
||||
0,
|
||||
100,
|
||||
0,
|
||||
[],
|
||||
$this->user
|
||||
|
|
@ -184,7 +184,7 @@ class FileSearchBackendTest extends TestCase {
|
|||
'mtime',
|
||||
10
|
||||
),
|
||||
0,
|
||||
100,
|
||||
0,
|
||||
[],
|
||||
$this->user
|
||||
|
|
@ -213,7 +213,7 @@ class FileSearchBackendTest extends TestCase {
|
|||
'mimetype',
|
||||
FileInfo::MIMETYPE_FOLDER
|
||||
),
|
||||
0,
|
||||
100,
|
||||
0,
|
||||
[],
|
||||
$this->user
|
||||
|
|
|
|||
Loading…
Reference in a new issue