diff --git a/lib/Service/SearchMappingService.php b/lib/Service/SearchMappingService.php index efe4b069..f24c2abf 100644 --- a/lib/Service/SearchMappingService.php +++ b/lib/Service/SearchMappingService.php @@ -306,16 +306,16 @@ private function generateQueryContentFields(ISearchRequest $request, QueryConten */ private function generateSearchQueryAccess(IDocumentAccess $access): array { $query = []; - $query[] = ['term' => ['owner' => $access->getViewerId()]]; - $query[] = ['term' => ['users' => $access->getViewerId()]]; - $query[] = ['term' => ['users' => '__all']]; + $query[] = ['term' => ['owner.keyword' => $access->getViewerId()]]; + $query[] = ['term' => ['users.keyword' => $access->getViewerId()]]; + $query[] = ['term' => ['users.keyword' => '__all']]; foreach ($access->getGroups() as $group) { - $query[] = ['term' => ['groups' => strtolower($group)]]; + $query[] = ['term' => ['groups.keyword' => $group]]; } foreach ($access->getCircles() as $circle) { - $query[] = ['term' => ['circles' => strtolower($circle)]]; + $query[] = ['term' => ['circles.keyword' => $circle]]; } return $query;