component't フィールドの制限に問題があります。私のモデル構造は以下のとおりです
class Category {
String name;
String description;
Date createDate
static hasMany = [items: Item]
static searchable = true
}
と
class Item {
String name
String description
Category category
static belogsTo = Category
static searchable = {
name boost: 2.0
description boost: 2.0
category component: true
content: spellCheck 'include'
}
}
以下は私のクエリです
def items = Item.search({
must(queryString(key))
must(term('$/Item/category/name', category))
//must(term('Item.category.name', category))
}, sort: params.sort, order: "asc").results;
ここでは、検索結果は常に空です。足りないものはありますか?「。」で試しました。および他の「$」オプションと運がない。