Skip to content

Commit

Permalink
[BUG] 🐛 Fix no users are returned when doing fuzzysearch
Browse files Browse the repository at this point in the history
Signed-off-by: Cécile Chemin <[email protected]>
  • Loading branch information
CChemin committed Aug 30, 2024
1 parent 1b34150 commit 082e520
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ public PageResult<User> fuzzySearchUsers(
"[ÀÁÂÃÄAÅÇCÈÉÊËEÌÍIÎÏÐÒÓÔOÕÖÙUÚÛÜÝYŸàáâãäåçèéêëìíîïðòóôõöùúûüýÿaeiouc \\-']",
"*")
.replaceAll("\\*+", "*"));
int originalPageSize = pageable.getSize();
pageable.setSize(50000);
PageResult<User> results =
searchOnLdap(
config.get(GlobalKeysConfig.USER_SOURCE),
Expand All @@ -162,7 +164,9 @@ public PageResult<User> fuzzySearchUsers(
.filter(
u ->
removeSpecialChars((String) u.getAttributes().get("common_name"))
.equalsIgnoreCase(normalizedCommonName))
.toUpperCase()
.contains(normalizedCommonName.toUpperCase()))
.limit(originalPageSize)
.collect(Collectors.toList());
results.setResults(filteredUsers);
return results;
Expand Down

0 comments on commit 082e520

Please sign in to comment.