简体   繁体   English

如何在 vespa.ai 中找到不同的记录?

[英]How to find distinct records in vespa.ai?

We have a use case where we need to find out the distinct (unique) records.我们有一个用例,我们需要找出不同的(唯一的)记录。

We have 5 different keys in a document they are all searchable, need to find the distinct records using one key.我们在一个文档中有 5 个不同的键,它们都是可搜索的,需要使用一个键找到不同的记录。

I also need to implement pagination on that distinct records.我还需要在不同的记录上实现分页。

See https://docs.vespa.ai/documentation/grouping.html .请参阅https://docs.vespa.ai/documentation/grouping.html The Vespa grouping language also supports pagination. Vespa 分组语言也支持分页。

Example:例子:

select ... | all(group(key) max(10) each( max(3) each(output(summary())))) 

Will group hits by the key field, display at max 10 unique key values and for each unique key value render 3 best hits.将按键字段对点击进行分组,最多显示 10 个唯一键值,并为每个唯一键值呈现 3 个最佳点击。 Groups are by default ordered by the max relevancy of a hit in the group.默认情况下,组按组中命中的最大相关性排序。 When using max() you'll be able to paginate using the continuation parameter to fetch more groups or more hits.使用 max() 时,您将能够使用 continuation 参数进行分页以获取更多组或更多命中。

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

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