implement PagedProvider for file search
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
b6af62fd24
commit
a5ceded17f
|
@ -30,12 +30,13 @@
|
||||||
namespace OC\Search\Provider;
|
namespace OC\Search\Provider;
|
||||||
|
|
||||||
use OC\Files\Filesystem;
|
use OC\Files\Filesystem;
|
||||||
|
use OCP\Search\PagedProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provide search results from the 'files' app
|
* Provide search results from the 'files' app
|
||||||
* @deprecated 20.0.0
|
* @deprecated 20.0.0
|
||||||
*/
|
*/
|
||||||
class File extends \OCP\Search\Provider {
|
class File extends PagedProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search for files and folders matching the given query
|
* Search for files and folders matching the given query
|
||||||
|
@ -88,4 +89,12 @@ class File extends \OCP\Search\Provider {
|
||||||
// return
|
// return
|
||||||
return $results;
|
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