Given the following domain class:
class Test {
String name
Integer val1, val2
}
I'm currently searching this class with the following criteria:
Test.createCriteria().list(params) {
params.key.split(' ').each {
ilike('name', "%${it}%")
}
gtProperty('val1', 'val2')
}
I'm trying to use Grails Searchable Plugin to improve my search results. More specifically its Query Builder. The only problem is that I can't find a way to filter results where val1 > val2
. As shown bellow:
Test.search(params) {
must(queryString(params.key))
must(
// Something to require that val1 > val2
)
}
I could filter it after searching but it would mess pagination.
Any ideas?