diff --git a/gravitee-apim-rest-api/gravitee-apim-rest-api-service/src/main/java/io/gravitee/rest/api/service/impl/search/lucene/transformer/UserDocumentTransformer.java b/gravitee-apim-rest-api/gravitee-apim-rest-api-service/src/main/java/io/gravitee/rest/api/service/impl/search/lucene/transformer/UserDocumentTransformer.java index 96dca58d43c..b2a7122bc08 100644 --- a/gravitee-apim-rest-api/gravitee-apim-rest-api-service/src/main/java/io/gravitee/rest/api/service/impl/search/lucene/transformer/UserDocumentTransformer.java +++ b/gravitee-apim-rest-api/gravitee-apim-rest-api-service/src/main/java/io/gravitee/rest/api/service/impl/search/lucene/transformer/UserDocumentTransformer.java @@ -123,7 +123,9 @@ public Document transform(UserEntity user) { logger.warn("Email of the user {} is not valid", user.getId()); } else { // For security reasons, we remove the domain part of the email - doc.add(new StringField(FIELD_EMAIL, user.getEmail().substring(0, user.getEmail().indexOf('@')), Field.Store.NO)); + doc.add( + new StringField(FIELD_EMAIL, user.getEmail().substring(0, user.getEmail().indexOf('@')).toLowerCase(), Field.Store.NO) + ); } }