[ 
https://issues.apache.org/jira/browse/FINERACT-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Adam Saghy resolved FINERACT-2702.
----------------------------------
    Resolution: Fixed

> /v2/clients/search performs case-sensitive matching instead of 
> case-insensitive 
> --------------------------------------------------------------------------------
>
>                 Key: FINERACT-2702
>                 URL: https://issues.apache.org/jira/browse/FINERACT-2702
>             Project: Apache Fineract
>          Issue Type: Bug
>          Components: Client
>            Reporter: Foo Developer
>            Assignee: Foo Developer
>            Priority: Minor
>              Labels: java
>             Fix For: 1.16.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> h3. Summary
> The client search endpoint ({{{}GET /v2/clients/search{}}}) builds its query 
> predicates using case-sensitive {{LIKE}} comparisons, so a search term that 
> differs only in letter case from the stored value fails to match.
> h3. Steps to Reproduce
>  # Create a client with, e.g., display name {{{}John Smith{}}}.
>  # Call {{{}GET /v2/clients/search?searchText=john{}}}.
>  # Observe that the client is not returned, even though {{john}} is a 
> case-insensitive substring of {{{}John Smith{}}}.
> h3. Expected Behavior
> Search should match regardless of case, consistent with how users typically 
> expect free-text search to behave (and consistent with account number, mobile 
> number, external ID, and identifier document key fields, which have the same 
> issue).
> h3. Actual Behavior
> Only exact-case substring matches are returned, since the predicates in 
> {{SearchingClientRepositoryImpl.searchByText}} compare the raw {{searchText}} 
> against {{{}accountNumber{}}}, {{{}displayName{}}}, {{{}externalId{}}}, 
> {{{}mobileNo{}}}, and {{identifiers.documentKey}} without any case 
> normalization.
> h3. Suggested Fix
> Lower-case the search term and wrap each compared field with 
> {{CriteriaBuilder.lower(...)}} (or the {{LOWER()}} SQL function, for fields 
> whose JPA path type requires {{{}cb.function("LOWER", ...){}}}), so the 
> {{LIKE}} comparison is case-insensitive on both sides.
> h3. Affected File
> {{fineract-core/src/main/java/org/apache/fineract/portfolio/client/domain/search/SearchingClientRepositoryImpl.java}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to