summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-12-06 11:29:14 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-12-09 20:38:13 +0100
commit5dba8d318dfbcd5b0e2a5feabe6e61882ef73c72 (patch)
tree33e4a8cde0aed764c777a0b1a1d947ddd633b9ef /lib
parentbb8ac6ca34aa84a9c43fb841a863438b025120a1 (diff)
downloadnextcloud-server-5dba8d318dfbcd5b0e2a5feabe6e61882ef73c72.tar.gz
nextcloud-server-5dba8d318dfbcd5b0e2a5feabe6e61882ef73c72.zip
Fix search limit to home
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Cache.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index 5c5146a569f..92e81cd0f07 100644
--- a/lib/private/Files/Cache/Cache.php
+++ b/lib/private/Files/Cache/Cache.php
@@ -797,6 +797,10 @@ class Cache implements ICache {
$query->andWhere($searchExpr);
}
+ if ($searchQuery->limitToHome() && ($this instanceof HomeCache)) {
+ $query->andWhere($builder->expr()->like('path', $query->expr()->literal('files/%')));
+ }
+
$this->querySearchHelper->addSearchOrdersToQuery($query, $searchQuery->getOrder());
if ($searchQuery->getLimit()) {