diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-03-18 08:21:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 08:21:50 +0100 |
commit | 73d2f42d4100c79437db540ac57313d7536ba0f4 (patch) | |
tree | 183f0c9858f47dac990ec496a079abae82931d2b /apps/files | |
parent | 4ebf9c2d1a307b77c5d9a79b0de0a59821be4e68 (diff) | |
parent | a5ceded17f6ba15ffdb89c3d0641e53fb1ecb21a (diff) | |
download | nextcloud-server-73d2f42d4100c79437db540ac57313d7536ba0f4.tar.gz nextcloud-server-73d2f42d4100c79437db540ac57313d7536ba0f4.zip |
Merge pull request #26087 from nextcloud/backport/26049/stable21
[stable21] limit constructing of result objects in file search
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/lib/Search/FilesSearchProvider.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/files/lib/Search/FilesSearchProvider.php b/apps/files/lib/Search/FilesSearchProvider.php index 93600119357..1c4bc75ade7 100644 --- a/apps/files/lib/Search/FilesSearchProvider.php +++ b/apps/files/lib/Search/FilesSearchProvider.php @@ -103,7 +103,7 @@ class FilesSearchProvider implements IProvider { // Make sure we setup the users filesystem $this->rootFolder->getUserFolder($user->getUID()); - return SearchResult::complete( + return SearchResult::paginated( $this->l10n->t('Files'), array_map(function (FileResult $result) { // Generate thumbnail url @@ -121,7 +121,8 @@ class FilesSearchProvider implements IProvider { $searchResultEntry->addAttribute('fileId', (string)$result->id); $searchResultEntry->addAttribute('path', $result->path); return $searchResultEntry; - }, $this->fileSearch->search($query->getTerm())) + }, $this->fileSearch->search($query->getTerm(), $query->getLimit(), (int)$query->getCursor())), + $query->getCursor() + $query->getLimit() ); } |