summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2020-12-04 08:42:15 +0100
committerGitHub <noreply@github.com>2020-12-04 08:42:15 +0100
commit32ded877dc30b18f6eba7f3854988ce2992feb00 (patch)
tree56018cd5f1a08d8627753c6d693ef8a5a919a47d /apps
parent3f88dbd25956897440ab0e34053551a77a1e922f (diff)
parent885dabb761c283be61ea4dd96e04146c98c02d1c (diff)
downloadnextcloud-server-32ded877dc30b18f6eba7f3854988ce2992feb00.tar.gz
nextcloud-server-32ded877dc30b18f6eba7f3854988ce2992feb00.zip
Merge pull request #24474 from nextcloud/enhancement/unified-search-result-attributes
Allow unified search results to have attributes
Diffstat (limited to 'apps')
-rw-r--r--apps/files/lib/Search/FilesSearchProvider.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files/lib/Search/FilesSearchProvider.php b/apps/files/lib/Search/FilesSearchProvider.php
index 5c97e771ab7..a3c6120ef13 100644
--- a/apps/files/lib/Search/FilesSearchProvider.php
+++ b/apps/files/lib/Search/FilesSearchProvider.php
@@ -110,13 +110,16 @@ class FilesSearchProvider implements IProvider {
? $this->urlGenerator->linkToRouteAbsolute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->id])
: '';
- return new SearchResultEntry(
+ $searchResultEntry = new SearchResultEntry(
$thumbnailUrl,
$result->name,
$this->formatSubline($result),
$this->urlGenerator->getAbsoluteURL($result->link),
$result->type === 'folder' ? 'icon-folder' : $this->mimeTypeDetector->mimeTypeIcon($result->mime_type)
);
+ $searchResultEntry->addAttribute('fileId', (string)$result->id);
+ $searchResultEntry->addAttribute('path', $result->path);
+ return $searchResultEntry;
}, $this->fileSearch->search($query->getTerm()))
);
}