diff options
author | Robin Appelman <robin@icewind.nl> | 2021-03-11 17:10:24 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-03-11 17:18:38 +0100 |
commit | b62ee577d7032273540c5332d9aa151646ce241c (patch) | |
tree | 82094da308529471bd0ea6f4e666b1071edd842b /lib/private/Search | |
parent | 424db15deaef20856e29ba1c886f06864a393eea (diff) | |
download | nextcloud-server-b62ee577d7032273540c5332d9aa151646ce241c.tar.gz nextcloud-server-b62ee577d7032273540c5332d9aa151646ce241c.zip |
implement PagedProvider for file search
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Search')
-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); + } + } } |