Merge pull request #18263 from nextcloud/fix/search/limit_to_home_limit

Fix search limit to home
This commit is contained in:
Roeland Jago Douma 2019-12-09 21:13:09 +01:00 committed by GitHub
commit 905cd37626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -797,6 +797,10 @@ class Cache implements ICache {
$query->andWhere($searchExpr); $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()); $this->querySearchHelper->addSearchOrdersToQuery($query, $searchQuery->getOrder());
if ($searchQuery->getLimit()) { if ($searchQuery->getLimit()) {