implement PagedProvider for file search
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
57042ab107
commit
e36e4a571e
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue