Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
implement PagedProvider for file search
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Mar 11, 2021
commit b62ee577d7032273540c5332d9aa151646ce241c
11 changes: 10 additions & 1 deletion lib/private/Search/Provider/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -88,4 +89,12 @@ public function search($query, int $limit = null, int $offset = null) {
// 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);
}
}
}