1) If you are using a Criteria request, then:
params.max = Math.min(max ?: 10, 100) Integer offset = params.offset as Integer ?: 0 List userInstanceList = User.createCriteria().list(max:params.max,offset:offset) { or { ilike('name', "%${name}%") ilike('email', "%${email}%") } order('dateCreated', 'desc') }
2) If you are using a GORM request, then:
params.max = Math.min(max ?: 10, 100) Integer offset = params.offset as Integer ?: 0 List<User> userList=User.list(max:params.max,offset:offset)
source share