summaryrefslogtreecommitdiffstats
path: root/apps/files/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-12-02 14:26:48 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-12-03 18:24:33 +0100
commit885dabb761c283be61ea4dd96e04146c98c02d1c (patch)
tree0f6b3f44c40101fc600b499b5f7288c34b8220f1 /apps/files/lib
parentcc92d5a293e85a8d67ed30e48bcad09fc03325f5 (diff)
downloadnextcloud-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.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()))
);
}