我有两个这样的域类:
class ExhibitionPrint {
Exhibition exhibition
Print print
String title
String description
....
static searchable = {
printSizes component: true
exhibition component: true
}
}
和
class Exhibition {
String title
boolean isPublished
....
static hasMany = [exhibitionPrints: ExhibitionPrint]
static searchable = {
exhibitionPrints component: true
}
}
我在搜索中使用了闭包,但它似乎不起作用,即使 Exhibition.isPublished 等于 false,我也会得到结果。我有这样的事情:
def searchResult = ExhibitionPrint.search{
must{
queryString(query)
term("ExhibitionPrint.exhibition.isPublished", true)
}
}.results
知道如何实现吗?