summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-12-11 11:16:34 +0100
committerGitHub <noreply@github.com>2019-12-11 11:16:34 +0100
commit2164ef045f88533cb3ca1df3881c3cb6b78e9018 (patch)
tree98e686657777e9d0fa1be2418fb4c57e86e69039
parent68d59915d6084c92799c22196012e32f7bb12be4 (diff)
parent73ce7f6c8a1d361023d27c9d3548586c49d7dce9 (diff)
downloadnextcloud-server-2164ef045f88533cb3ca1df3881c3cb6b78e9018.tar.gz
nextcloud-server-2164ef045f88533cb3ca1df3881c3cb6b78e9018.zip
Merge pull request #18342 from nextcloud/enh/filesearch/offset
Add offset for home limited searches
-rw-r--r--apps/dav/lib/Files/FileSearchBackend.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php
index 5cbb30a2706..751580eabfc 100644
--- a/apps/dav/lib/Files/FileSearchBackend.php
+++ b/apps/dav/lib/Files/FileSearchBackend.php
@@ -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