我设法为Solr Indexing逻辑添加了子文档,其中父文档是“艺术品”对象,子文档是“商品”,如下所示:
"response":{"numFound":3,"start":0,"docs":[
{
"id":"349",
"key":"123",
"item.product":"Classic Tee",
"item.colors":["Black","White"],
"item.sizes":["S","M","L"],
},
{
"id":"350",
"key":"321",
"item.product":"Ringspun Tee",
"item.colors":["Brown", "Red", "Blue"],
"item.sizes":["XS"],
},
{
"id":"348",
"key":"abc",
"artist":"Van Gogh",
"art_link":"www.art.com/art.png",
"default_item_key":"123"
}
]}}
现在,如果我查询“ Van Gogh”,我会取回文件348、350、349,这表明我正确添加了子文件。但是,我不知道如何配置要返回的内容,例如,我希望:
-查询“ Van Gogh”仅返回父文档,因此我不希望返回ID为349和350的文档。
-查询“黑色”,仅获取文档349和348。
-查询“ Tee”并取回所有3个文档。