美文网首页
Pipeline aggregations

Pipeline aggregations

作者: subway1211 | 来源:发表于2017-02-15 10:32 被阅读0次

    Pipeline aggregations work on the outputs produced from other aggregations rather than from document sets, adding information to the output tree. There are many different types of pipeline aggregation, each computing different information from other aggregations, but these types can be broken down into two families:

    Parent

    A family of pipeline aggregations that is provided with the output of its parent aggregation and is able to compute new buckets or new aggregations to add to existing buckets.

    Sibling

    Pipeline aggregations that are provided with the output of a sibling aggregation and are able to compute a new aggregation which will be at the same level as the sibling aggregation.

    Pipeline aggregations can reference the aggregations they need to perform their computation by using thebuckets_pathparameter to indicate the paths to the required metrics. The syntax for defining these paths can be found in thebuckets_pathSyntaxsection below.

    Pipeline aggregations cannot have sub-aggregations but depending on the type it can reference another pipeline in thebuckets_pathallowing pipeline aggregations to be chained. For example, you can chain together two derivatives to calculate the second derivative (i.e. a derivative of a derivative).

    管道聚合处理的对象是其它聚合的输出(桶或者桶的某些权值),而不是直接针对文档。

    管道聚合的作用是为输出增加一些有用信息。

    Avg Bucket Aggregation(sibliing)

    桶均值聚合——基于兄弟聚合的某个权值,求所有桶的权值均值。

    用于计算的兄弟聚合必须是多桶聚合。

    用于计算的权值必须是数值类型。

    Derivative Aggregation(parent)

    求导聚合——基于父聚合(只能是histogram或date_histogram类型)的某个权值,对权值求导。

    用于求导的权值必须是数值类型。

    封闭直方图(histogram)聚合的 min_doc_count 必须是 0。

    Max Bucket Aggregation(sibling)

    桶最大值聚合——基于兄弟聚合的某个权值,输出权值最大的那一个桶。

    用于计算的权值必须是数值类型。

    用于计算的兄弟聚合必须是多桶聚合类型。

    Min Bucket Aggregation(sibling)

    桶最小值聚合——基于兄弟聚合的某个权值,输出权值最小的一个桶。

    用于计算的权值必须是数值类型。

    用于计算的兄弟聚合必须是多桶聚合类型。

    Sum Buchet Aggregation(sibling)

    桶求和聚合——基于兄弟聚合的权值,对所有桶的权值求和。

    用于计算的权值必须是数值类型。

    用于计算的兄弟聚合必须是多桶聚合类型。

    Stats Bucket Aggregation(sibling)

    桶统计信息聚合——基于兄弟聚合的某个权值,对【桶的信息】进行一些统计学运算(总计多少个桶、所有桶中该权值的最大值、最小等)。

    用于计算的权值必须是数值类型。

    用于计算的兄弟聚合必须是多桶聚合类型。

    Extended Stats Bucket Aggregation(sibling)

    扩展桶统计聚合——基于兄弟聚合的某个权值,对【桶信息】进行一系列统计学计算(比普通的统计聚合多了一些统计值)。

    用于计算的权值必须是数值类型。

    用于计算的兄弟聚合必须是多桶聚合类型。

    Percentiles Bucket Aggregation(sibling)

    桶百分比聚合——基于兄弟聚合的某个权值,计算权值的百分百。

    用于计算的权值必须是数值类型。

    用于计算的兄弟聚合必须是多桶聚合类型。

    对百分百的计算是精确的(不像Percentiles Metric聚合是近似值),所以可能会消耗大量内存

    Moving Average Aggregation(parent)

    窗口平均值聚合——基于已经排序过的数据,计算出处在当前出口中数据的平均值。

    比如窗口大小为 5 ,对数据 1—10 的部分窗口平均值如下:

    (1 + 2 + 3 + 4 + 5) / 5 = 3

    (2 + 3 + 4 + 5 + 6) / 5 = 4

    (3 + 4 + 5 + 6 + 7) / 5 = 5

    Cumulative Sum Aggregation(parent)

    累计和聚合——基于父聚合(只能是histogram或date_histogram类型)的某个权值,对权值在每一个桶中求所有之前的桶的该值累计的和。

    用于计算的权值必须是数值类型。

    封闭直方图(histogram)聚合的 min_doc_count 必须是 0。

    Bucket Script Aggregation(parent)

    桶脚本聚合——基于父聚合的【一个或多个权值】,对这些权值通过脚本进行运算。

    用于计算的父聚合必须是多桶聚合。

    用于计算的权值必须是数值类型。

    执行脚本必须要返回数值型结果。

    Bucket Selector Aggregation(parent)

    桶选择器聚合——基于父聚合的【一个或多个权值】,通过脚本对权值进行计算,并决定父聚合的哪些桶需要保留,其余的将被丢弃。

    用于计算的父聚合必须是多桶聚合。

    用于计算的权值必须是数值类型。

    运算的脚本必须是返回 boolean 类型,如果脚本是脚本表达式形式给出,那么允许返回数值类型。

    Serial Differencing Aggregation(parent)

    串行差分聚合——基于父聚合(只能是histogram或date_histogram类型)的某个权值,对权值值进行差分运算,(取时间间隔,后一刻的值减去前一刻的值:f(X) = f(Xt) – f(Xt-n))。

    用于计算的父聚合必须是多桶聚合。

    相关文章

      网友评论

          本文标题:Pipeline aggregations

          本文链接:https://www.haomeiwen.com/subject/ifxqwttx.html