diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-12-02 14:26:48 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-12-03 18:24:33 +0100 |
commit | 885dabb761c283be61ea4dd96e04146c98c02d1c (patch) | |
tree | 0f6b3f44c40101fc600b499b5f7288c34b8220f1 /apps/files/lib | |
parent | cc92d5a293e85a8d67ed30e48bcad09fc03325f5 (diff) | |
download | nextcloud-server-885dabb761c283be61ea4dd96e04146c98c02d1c.tar.gz nextcloud-server-885dabb761c283be61ea4dd96e04146c98c02d1c.zip |
Add attributes to file search results
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/Search/FilesSearchProvider.php | 5 |
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())) ); } |