I'm querying solr through solrcrudrepository. I have defined a method inside the repository named: findByUsernameContainsOrNameContains(String username, String name). The method should compare the search term with usernames and names and if there is a match, it would return the document (according to docs) . That's not how it's behaving, instead of matching the term it returns an entire list of documents stored in solr. Even when the search term is an empty string. What is the problem?
repo.findByUsernameContainsOrNameContains("someUsername", "someName");
will produce q=username:*someUsername* OR name:*someName*
once called with an empty String repo.findByUsernameContainsOrNameContains("", "someName");
this will be converted to q=username:** OR name:*someName*
So username:**
will match all documents having a username.