fix(search): add case insensitive

This commit is contained in:
2025-02-06 13:57:31 +01:00
parent b983f4e3ec
commit 4e9686d6a7
2 changed files with 6 additions and 6 deletions

View File

@@ -91,10 +91,10 @@ public class ClubService {
PanacheQuery<ClubModel> query;
if (country == null || country.isBlank())
query = repository.find("name LIKE ?1",
query = repository.find("LOWER(name) LIKE LOWER(?1)",
Sort.ascending("name"), search).page(Page.ofSize(limit));
else
query = repository.find("name LIKE ?1 AND country LIKE ?2",
query = repository.find("LOWER(name) LIKE LOWER(?1) AND country LIKE ?2",
Sort.ascending("name"), search, country + "%").page(Page.ofSize(limit));
return getPageResult(query, limit, page);
}