diff options
author | Robin Appelman <robin@icewind.nl> | 2021-05-06 21:23:09 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-06-14 16:11:32 +0200 |
commit | 27e50b24aab60112c05f88e570af099faeac0122 (patch) | |
tree | e43c71fd628027e5c348868848279f6b05a2e44d /lib/private/Files/Cache/QuerySearchHelper.php | |
parent | 5d1d53c42e9a8342f9fd2da815e6653a64203c0c (diff) | |
download | nextcloud-server-27e50b24aab60112c05f88e570af099faeac0122.tar.gz nextcloud-server-27e50b24aab60112c05f88e570af099faeac0122.zip |
some cleanup and documentation
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Cache/QuerySearchHelper.php')
-rw-r--r-- | lib/private/Files/Cache/QuerySearchHelper.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/Files/Cache/QuerySearchHelper.php b/lib/private/Files/Cache/QuerySearchHelper.php index 64a888f492c..393eb54e4fe 100644 --- a/lib/private/Files/Cache/QuerySearchHelper.php +++ b/lib/private/Files/Cache/QuerySearchHelper.php @@ -255,6 +255,11 @@ class QuerySearchHelper { } /** + * Perform a file system search in multiple caches + * + * the results will be grouped by the same array keys as the $caches argument to allow + * post-processing based on which cache the result came from + * * @template T of array-key * @param ISearchQuery $searchQuery * @param array<T, ICache> $caches @@ -304,10 +309,6 @@ class QuerySearchHelper { }, $caches)); $query->andWhere($this->searchOperatorToDBExpr($builder, new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_OR, $storageFilters))); - if ($searchQuery->limitToHome() && ($this instanceof HomeCache)) { - $query->andWhere($builder->expr()->like('path', $query->expr()->literal('files/%'))); - } - $this->addSearchOrdersToQuery($query, $searchQuery->getOrder()); if ($searchQuery->getLimit()) { @@ -327,6 +328,7 @@ class QuerySearchHelper { $result->closeCursor(); // loop trough all caches for each result to see if the result matches that storage + // results are grouped by the same array keys as the caches argument to allow the caller to distringuish the source of the results $results = array_fill_keys(array_keys($caches), []); foreach ($rawEntries as $rawEntry) { foreach ($caches as $cacheKey => $cache) { |