Add offset for home limited searches
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
da571c915e
commit
73ce7f6c8a
1 changed files with 3 additions and 1 deletions
|
@ -275,6 +275,7 @@ class FileSearchBackend implements ISearchBackend {
|
|||
// TODO offset
|
||||
$limit = $query->limit;
|
||||
$orders = array_map([$this, 'mapSearchOrder'], $query->orderBy);
|
||||
$offset = 0;
|
||||
|
||||
$limitHome = false;
|
||||
$ownerProp = $this->extractWhereValue($query->where, FilesPlugin::OWNER_ID_PROPERTYNAME, Operator::OPERATION_EQUAL);
|
||||
|
@ -284,12 +285,13 @@ class FileSearchBackend implements ISearchBackend {
|
|||
} else {
|
||||
throw new \InvalidArgumentException("Invalid search value for '{http://owncloud.org/ns}owner-id', only the current user id is allowed");
|
||||
}
|
||||
$offset = $limit->firstResult;
|
||||
}
|
||||
|
||||
return new SearchQuery(
|
||||
$this->transformSearchOperation($query->where),
|
||||
(int)$limit->maxResults,
|
||||
0,
|
||||
$offset,
|
||||
$orders,
|
||||
$this->user,
|
||||
$limitHome
|
||||
|
|
Loading…
Reference in a new issue