Skip to content

Commit 817ac06

Browse files
committed
fixup! feat(dav): Support multiple scopes in DAV search
1 parent 91e6cdd commit 817ac06

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

apps/dav/lib/Files/FileSearchBackend.php

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ public function search(Query $search): array {
169169
if (!$node instanceof Directory) {
170170
throw new \InvalidArgumentException('Search is only supported on directories');
171171
}
172+
172173
$fileInfo = $node->getFileInfo();
173174
/** @var Folder $folder */
174175
$folder = $this->rootFolder->get($fileInfo->getPath());
@@ -179,11 +180,23 @@ public function search(Query $search): array {
179180
} else {
180181
$internalPath = $folder->getInternalPath();
181182
}
182-
$scopes[] = new SearchComparison(
183-
ISearchComparison::COMPARE_LIKE,
184-
'path',
185-
$internalPath . '/%',
186-
''
183+
184+
$scopes[] = new SearchBinaryOperator(
185+
ISearchBinaryOperator::OPERATOR_AND,
186+
[
187+
new SearchComparison(
188+
ISearchComparison::COMPARE_EQUAL,
189+
'storage',
190+
$folderStorage->getCache()->getNumericStorageId(),
191+
''
192+
),
193+
new SearchComparison(
194+
ISearchComparison::COMPARE_LIKE,
195+
'path',
196+
$internalPath . '/%',
197+
''
198+
),
199+
]
187200
);
188201
}
189202

0 commit comments

Comments
 (0)