From b62ee577d7032273540c5332d9aa151646ce241c Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 11 Mar 2021 17:10:24 +0100 Subject: implement PagedProvider for file search Signed-off-by: Robin Appelman --- lib/private/Search/Provider/File.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/private/Search') 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); + } + } } -- cgit v1.2.3