I have a repository method that does a "starts with" (prefix) query on field userAccount.userName
. When I search for string without space, it returns proper results. But when I search for strings with space in it, it throws an exception.
My repository method:
public List<EsUser> findByUserAccountUserNameStartingWith(String term);
Search String: Tom Cruise
Exception:
org.springframework.dao.InvalidDataAccessApiUsageException: Cannot constructQuery '*"Tom Cruise"'. Use expression or multiple clauses instead.