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

前端之家收集整理的这篇文章主要介绍了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
}

如何添加搜索定义,以便我们可以按“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

猜你在找的设计模式相关文章