Skip to content
Merged
Changes from all commits
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
Add offset for home limited searches
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Dec 10, 2019
commit 73ce7f6c8a1d361023d27c9d3548586c49d7dce9
4 changes: 3 additions & 1 deletion apps/dav/lib/Files/FileSearchBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ private function transformQuery(Query $query): ISearchQuery {
// 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);
Expand All @@ -284,12 +285,13 @@ private function transformQuery(Query $query): ISearchQuery {
} 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
Expand Down