[英]Using imported fields as summary not working
在测试父/子功能时,创建了 2 个模式。
子架构:
schema item {
document item {
field id type long {
indexing : attribute
}
field campaign_ref type reference<campaign> {
indexing: attribute
}
}
import field campaign_ref.cpc as campaign_cpc {}
import field campaign_ref.syndicator_id as syndicator_id {}
}
和父模式:
schema campaign {
document campaign {
field id type long {
indexing : attribute
}
field cpc type float {
indexing : attribute
}
field syndicator_id type long {
indexing : attribute
}
}
}
这工作得很好。 然后在孩子的摘要中添加了一个导入字段 - 但它没有出现在搜索响应中。
子架构更改:
schema item {
document item {
field id type long {
indexing : attribute
}
field campaign_ref type reference<campaign> {
indexing: attribute
}
}
import field campaign_ref.cpc as campaign_cpc {}
import field campaign_ref.syndicator_id as syndicator_id {}
document-summary item_summary {
summary syndicator_id type long {}
}
}
该测试包含一个孩子和一个单亲。
{"yql" : "select * from item where syndicator_id = 1 limit 3" }
检索映射到 syndicator_id=1 的活动的项目子文档。 但是 syndicator_id 没有出现在以下字段中:
"children": [
{
"id": "id:candidation:item::2",
"relevance": 0.0017429193899782135,
"source": "vespa2",
"fields": {
"sddocname": "item",
"documentid": "id:candidation:item::2"
}
}
]
您需要在查询请求中询问item_summary
:
{
"yql" : "select * from item where syndicator_id = 1 limit 3",
"presentation.summary": "item_summary"
}
在上面的示例中,您请求default
文档摘要(通过在请求中未提及而隐含)。
请参阅https://docs.vespa.ai/en/parent-child.html和https://docs.vespa.ai/en/document-summaries.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.