加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Vespa:我们可以在嵌套字段上聚合吗?

发布时间:2020-12-14 04:55:29 所属栏目:百科 来源:网络整理
导读:在搜索定义中,struct中的字段不能具有“属性”索引. http://docs.vespa.ai/documentation/reference/search-definitions-reference.html#field_types 此外,默认情况下,struct和maps不是属性. 结果搜索定义如下所示: struct nlp { field token type string {
在搜索定义中,struct中的字段不能具有“属性”索引.

http://docs.vespa.ai/documentation/reference/search-definitions-reference.html#field_types

此外,默认情况下,struct和maps不是属性.
结果搜索定义如下所示:

struct nlp {
  field token type string {
      match: text //can't add indexing here
  }
}

field n type nlp {
      indexing: summary //can't add attribute here
}

如何添加搜索定义,以便我们可以按“n.token”进行分组?是否可以为struct字段添加属性或索引?或者按非属性字段分组?

解决方法

如果要使用索引搜索运行分组,则struct字段类型不能具有必要先决条件的属性,请参阅 http://docs.vespa.ai/documentation/reference/search-definitions-reference.html#struct

使用mode = index的struct字段唯一可以做的就是将它们作为摘要(响应)的一部分.您可以添加一个自定义搜索器,该搜索器在struct字段上进行聚合,分析前K个检索到的命中.见http://docs.vespa.ai/documentation/searcher-development.html

使用mode = streaming,您可以在struct字段上运行分组,更多关于流媒体http://docs.vespa.ai/documentation/streaming-search.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读