Using the grails graphics plugin, I would like to search all products in a specific category using the query builder, for example:
Products.search {
must(queryString(params.q))
must(term('??????','Food'))
}
Using 'category.name' returns: Could not find a match for aliases [category] and path [category.name]
class Product {
String name
String desc
Category category
static searchable = {
category component: true
}
}
class Category {
String name
static hasMany = [products: Product]
static searchable = true
}
Any ideas? Thank.
Micor source
share