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

ena*_*tor 4 vespa

在搜索定义中,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
}
Run Code Online (Sandbox Code Playgroud)

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

Jo *_*gum 5

如果要使用索引搜索运行分组,则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