简体   繁体   English

使用导入的字段作为摘要不起作用

[英]Using imported fields as summary not working

While testing out parent/child feature, created 2 schemas.在测试父/子功能时,创建了 2 个模式。

Child schema:子架构:

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 {}

}

And parent schema:和父模式:

schema campaign {
    document campaign {
        field id type long {
            indexing : attribute
        }
        field cpc type float {
            indexing : attribute
        }
        field syndicator_id type long {
            indexing : attribute
        }
    }
}

This worked fine.这工作得很好。 Then added to the child's summary an imported field - but it wasn't appearing the search response.然后在孩子的摘要中添加了一个导入字段 - 但它没有出现在搜索响应中。

Child schema change:子架构更改:

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 {}
}

} }

The test contains a single child and a single parent.该测试包含一个孩子和一个单亲。

{"yql" : "select * from item where syndicator_id = 1 limit 3" }

Retrieves the item child document that is mapped to a campaign with a syndicator_id=1.检索映射到 syndicator_id=1 的活动的项目子文档。 But syndicator_id doesn't appear in the fields:但是 syndicator_id 没有出现在以下字段中:

        "children": [
        {
            "id": "id:candidation:item::2",
            "relevance": 0.0017429193899782135,
            "source": "vespa2",
            "fields": {
                "sddocname": "item",
                "documentid": "id:candidation:item::2"
            }
        }
    ]

You need to ask for the item_summary in the query request:您需要在查询请求中询问item_summary

{
"yql" : "select * from item where syndicator_id = 1 limit 3",
"presentation.summary": "item_summary"
}

In the above example, you request the default document summary (implicit by not mentioning it in the request).在上面的示例中,您请求default文档摘要(通过在请求中未提及而隐含)。

See https://docs.vespa.ai/en/parent-child.html and https://docs.vespa.ai/en/document-summaries.html请参阅https://docs.vespa.ai/en/parent-child.htmlhttps://docs.vespa.ai/en/document-summaries.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM