[英]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.