From 7882cbc9ababc694bfe7d35f9851f7ca070bb353 Mon Sep 17 00:00:00 2001 From: vikrant Date: Mon, 2 Dec 2024 15:39:21 +0530 Subject: [PATCH] APIM-7554 fix: enable user search with case-insensitive email address --- .../search/lucene/transformer/UserDocumentTransformer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) + ); } }