In Java, the string search by its' substring goes like this:
String string = "Madam, I am Adam";
b = string.matches("(?i).*i am.*");
How to find an instance in Grails by name where query is any part of its name?
In Java, the string search by its' substring goes like this:
String string = "Madam, I am Adam";
b = string.matches("(?i).*i am.*");
How to find an instance in Grails by name where query is any part of its name?
I think this is what you're looking for
That is a case insensitive search for any record with
name
containing "I am". This is not an efficient way to query a database, so if your application will experience any kind of load, you should use it sparingly.Edit: Documentation