diff --git a/sugoi-api-ldap-store-provider/src/main/java/fr/insee/sugoi/store/ldap/LdapReaderStore.java b/sugoi-api-ldap-store-provider/src/main/java/fr/insee/sugoi/store/ldap/LdapReaderStore.java index e3d07adf..870cb493 100644 --- a/sugoi-api-ldap-store-provider/src/main/java/fr/insee/sugoi/store/ldap/LdapReaderStore.java +++ b/sugoi-api-ldap-store-provider/src/main/java/fr/insee/sugoi/store/ldap/LdapReaderStore.java @@ -149,6 +149,8 @@ public PageResult fuzzySearchUsers( "[ÀÁÂÃÄAÅÇCÈÉÊËEÌÍIÎÏÐÒÓÔOÕÖÙUÚÛÜÝYŸàáâãäåçèéêëìíîïðòóôõöùúûüýÿaeiouc \\-']", "*") .replaceAll("\\*+", "*")); + int originalPageSize = pageable.getSize(); + pageable.setSize(50000); PageResult results = searchOnLdap( config.get(GlobalKeysConfig.USER_SOURCE), @@ -162,7 +164,9 @@ public PageResult 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;