mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Merge pull request #46464 from nextcloud/unified-search-enhancements
Unified search: add attributes for clients
This commit is contained in:
commit
c9da3daf7b
2 changed files with 16 additions and 2 deletions
|
|
@ -111,7 +111,12 @@ class ContactsSearchProvider implements IFilteringProvider {
|
|||
$subline = $this->generateSubline($vCard);
|
||||
$resourceUrl = $this->getDeepLinkToContactsApp($addressBook['uri'], (string) $vCard->UID);
|
||||
|
||||
return new SearchResultEntry($thumbnailUrl, $title, $subline, $resourceUrl, 'icon-contacts-dark', true);
|
||||
$result = new SearchResultEntry($thumbnailUrl, $title, $subline, $resourceUrl, 'icon-contacts-dark', true);
|
||||
$result->addAttribute("displayName", $title);
|
||||
$result->addAttribute("email", $subline);
|
||||
$result->addAttribute("phoneNumber", (string)$vCard->TEL);
|
||||
|
||||
return $result;
|
||||
}, $searchResults);
|
||||
|
||||
return SearchResult::paginated(
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ use OCP\Search\SearchResultEntry;
|
|||
use Sabre\VObject\Component;
|
||||
use Sabre\VObject\DateTimeParser;
|
||||
use Sabre\VObject\Property;
|
||||
use Sabre\VObject\Property\ICalendar\DateTime;
|
||||
use function array_combine;
|
||||
use function array_fill;
|
||||
use function array_key_exists;
|
||||
|
|
@ -157,8 +158,16 @@ class EventsSearchProvider extends ACalendarSearchProvider implements IFiltering
|
|||
$calendar = $subscriptionsById[$eventRow['calendarid']];
|
||||
}
|
||||
$resourceUrl = $this->getDeepLinkToCalendarApp($calendar['principaluri'], $calendar['uri'], $eventRow['uri']);
|
||||
$result = new SearchResultEntry('', $title, $subline, $resourceUrl, 'icon-calendar-dark', false);
|
||||
|
||||
return new SearchResultEntry('', $title, $subline, $resourceUrl, 'icon-calendar-dark', false);
|
||||
$dtStart = $component->DTSTART;
|
||||
|
||||
if ($dtStart instanceof DateTime) {
|
||||
$startDateTime = $dtStart->getDateTime()->format('U');
|
||||
$result->addAttribute("createdAt", $startDateTime);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}, $searchResults);
|
||||
|
||||
return SearchResult::paginated(
|
||||
|
|
|
|||
Loading…
Reference in a new issue