Skip to content

Commit

Permalink
BUGFIX: Search assets case-insensitive
Browse files Browse the repository at this point in the history
This solves the problem that with Postgres the search was case-sensitive.
Other database platforms didn’t have this issue as they ran case-insensitive
comparisons by default.

Resolves: #3432
  • Loading branch information
Sebobo committed Feb 2, 2024
1 parent eb85240 commit ee83133
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Neos.Media/Classes/Domain/Repository/AssetRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ public function findBySearchTermOrTags($searchTerm, array $tags = [], AssetColle
$query = $this->createQuery();

$constraints = [
$query->like('title', '%' . $searchTerm . '%'),
$query->like('resource.filename', '%' . $searchTerm . '%'),
$query->like('caption', '%' . $searchTerm . '%')
$query->like('title', '%' . $searchTerm . '%', false),
$query->like('resource.filename', '%' . $searchTerm . '%', false),
$query->like('caption', '%' . $searchTerm . '%', false)
];
foreach ($tags as $tag) {
$constraints[] = $query->contains('tags', $tag);
Expand Down

0 comments on commit ee83133

Please sign in to comment.