diff options
author | Robin Appelman <robin@icewind.nl> | 2021-03-11 17:10:24 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-03-12 12:38:37 +0000 |
commit | a5ceded17f6ba15ffdb89c3d0641e53fb1ecb21a (patch) | |
tree | 7e3668989c9c8ad04b30f8d85b9c845877766fcf | |
parent | b6af62fd247567dc59c7671b50829392ba2f294b (diff) | |
download | nextcloud-server-a5ceded17f6ba15ffdb89c3d0641e53fb1ecb21a.tar.gz nextcloud-server-a5ceded17f6ba15ffdb89c3d0641e53fb1ecb21a.zip |
implement PagedProvider for file search
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | lib/private/Search/Provider/File.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/private/Search/Provider/File.php b/lib/private/Search/Provider/File.php index 688b6ad1e91..4125b1f7d70 100644 --- a/lib/private/Search/Provider/File.php +++ b/lib/private/Search/Provider/File.php @@ -30,12 +30,13 @@ namespace OC\Search\Provider; use OC\Files\Filesystem; +use OCP\Search\PagedProvider; /** * Provide search results from the 'files' app * @deprecated 20.0.0 */ -class File extends \OCP\Search\Provider { +class File extends PagedProvider { /** * Search for files and folders matching the given query @@ -88,4 +89,12 @@ class File extends \OCP\Search\Provider { // return return $results; } + + public function searchPaged($query, $page, $size) { + if ($size === 0) { + return $this->search($query); + } else { + return $this->search($query, $size, ($page - 1) * $size); + } + } } |