<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pipeline aggregations on INFINI Pizza</title><link>/docs/references/aggregation/pipeline/</link><description>Recent content in Pipeline aggregations on INFINI Pizza</description><generator>Hugo</generator><language>en</language><atom:link href="/docs/references/aggregation/pipeline/index.xml" rel="self" type="application/rss+xml"/><item><title>Avg bucket aggregation</title><link>/docs/references/aggregation/pipeline/avg-bucket/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/avg-bucket/</guid><description>&lt;h1 id="avg-bucket-aggregation">
 Avg bucket aggregation
 &lt;a class="anchor" href="#avg-bucket-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A sibling pipeline aggregation computing the &lt;strong>average&lt;/strong> of a metric
across another aggregation&amp;rsquo;s buckets.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="s2">&amp;#34;avg_day&amp;#34;&lt;/span>&lt;span class="err">:&lt;/span> &lt;span class="p">{&lt;/span> &lt;span class="nt">&amp;#34;avg_bucket&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span> &lt;span class="nt">&amp;#34;buckets_path&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;per_day&amp;gt;revenue&amp;#34;&lt;/span> &lt;span class="p">}&lt;/span> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="example">
 Example
 &lt;a class="anchor" href="#example">#&lt;/a>
&lt;/h2>
&lt;p>Average daily revenue across the date-histogram buckets:&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: { &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } } }
 },
 &amp;#34;avg_day&amp;#34;: { &amp;#34;avg_bucket&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;per_day&amp;gt;revenue&amp;#34; } }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-avg_bucket">
 Parameters for &lt;code>avg_bucket&lt;/code>
 &lt;a class="anchor" href="#parameters-for-avg_bucket">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, string) Path to the consumed metric:
&lt;code>&amp;quot;&amp;lt;bucket_agg&amp;gt;&amp;gt;&amp;lt;metric&amp;gt;&amp;quot;&lt;/code>.&lt;/li>
&lt;li>&lt;code>format&lt;/code> &lt;br>
(Optional, string) Output number format.&lt;/li>
&lt;li>&lt;code>gap_policy&lt;/code> &lt;br>
(Optional, string) What to do with missing buckets: &lt;code>skip&lt;/code> (default)
or &lt;code>insert_zeros&lt;/code>.&lt;/li>
&lt;/ul></description></item><item><title>Sum bucket aggregation</title><link>/docs/references/aggregation/pipeline/sum-bucket/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/sum-bucket/</guid><description>&lt;h1 id="sum-bucket-aggregation">
 Sum bucket aggregation
 &lt;a class="anchor" href="#sum-bucket-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A sibling pipeline aggregation computing the &lt;strong>sum&lt;/strong> of a metric across
another aggregation&amp;rsquo;s buckets — e.g. &amp;ldquo;total of the daily totals&amp;rdquo;.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: { &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } } }
 },
 &amp;#34;grand_total&amp;#34;: { &amp;#34;sum_bucket&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;per_day&amp;gt;revenue&amp;#34; } }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;p>The result equals the plain &lt;code>sum&lt;/code> over all documents (&lt;code>6750&lt;/code>).&lt;/p></description></item><item><title>Min bucket aggregation</title><link>/docs/references/aggregation/pipeline/min-bucket/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/min-bucket/</guid><description>&lt;h1 id="min-bucket-aggregation">
 Min bucket aggregation
 &lt;a class="anchor" href="#min-bucket-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A sibling pipeline aggregation identifying the &lt;strong>smallest&lt;/strong> per-bucket
metric value.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_type&amp;#34;: {
 &amp;#34;terms&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;type&amp;#34;, &amp;#34;size&amp;#34;: 5 },
 &amp;#34;aggs&amp;#34;: { &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } } }
 },
 &amp;#34;worst_seller&amp;#34;: { &amp;#34;min_bucket&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;per_type&amp;gt;revenue&amp;#34; } }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-min_bucket">
 Parameters for &lt;code>min_bucket&lt;/code>
 &lt;a class="anchor" href="#parameters-for-min_bucket">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, string) Path to the consumed metric.&lt;/li>
&lt;li>&lt;code>format&lt;/code> &lt;br>
(Optional, string) Output number format.&lt;/li>
&lt;li>&lt;code>gap_policy&lt;/code> &lt;br>
(Optional, string) &lt;code>skip&lt;/code> (default) or &lt;code>insert_zeros&lt;/code>.&lt;/li>
&lt;/ul></description></item><item><title>Max bucket aggregation</title><link>/docs/references/aggregation/pipeline/max-bucket/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/max-bucket/</guid><description>&lt;h1 id="max-bucket-aggregation">
 Max bucket aggregation
 &lt;a class="anchor" href="#max-bucket-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A sibling pipeline aggregation identifying the &lt;strong>largest&lt;/strong> per-bucket
metric value — e.g. the best-performing group.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_type&amp;#34;: {
 &amp;#34;terms&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;type&amp;#34;, &amp;#34;size&amp;#34;: 5 },
 &amp;#34;aggs&amp;#34;: { &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } } }
 },
 &amp;#34;best_seller&amp;#34;: { &amp;#34;max_bucket&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;per_type&amp;gt;revenue&amp;#34; } }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-max_bucket">
 Parameters for &lt;code>max_bucket&lt;/code>
 &lt;a class="anchor" href="#parameters-for-max_bucket">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, string) Path to the consumed metric.&lt;/li>
&lt;li>&lt;code>format&lt;/code> &lt;br>
(Optional, string) Output number format.&lt;/li>
&lt;li>&lt;code>gap_policy&lt;/code> &lt;br>
(Optional, string) &lt;code>skip&lt;/code> (default) or &lt;code>insert_zeros&lt;/code>.&lt;/li>
&lt;/ul></description></item><item><title>Stats bucket aggregation</title><link>/docs/references/aggregation/pipeline/stats-bucket/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/stats-bucket/</guid><description>&lt;h1 id="stats-bucket-aggregation">
 Stats bucket aggregation
 &lt;a class="anchor" href="#stats-bucket-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A sibling pipeline aggregation returning count/min/max/avg/sum of a
metric &lt;strong>across buckets&lt;/strong> — the stats of the per-bucket values.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: { &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } } }
 },
 &amp;#34;day_stats&amp;#34;: { &amp;#34;stats_bucket&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;per_day&amp;gt;revenue&amp;#34; } }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-stats_bucket">
 Parameters for &lt;code>stats_bucket&lt;/code>
 &lt;a class="anchor" href="#parameters-for-stats_bucket">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, string) Path to the consumed metric.&lt;/li>
&lt;li>&lt;code>format&lt;/code> &lt;br>
(Optional, string) Output number format.&lt;/li>
&lt;li>&lt;code>gap_policy&lt;/code> &lt;br>
(Optional, string) &lt;code>skip&lt;/code> (default) or &lt;code>insert_zeros&lt;/code>.&lt;/li>
&lt;/ul></description></item><item><title>Extended stats bucket aggregation</title><link>/docs/references/aggregation/pipeline/extended-stats-bucket/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/extended-stats-bucket/</guid><description>&lt;h1 id="extended-stats-bucket-aggregation">
 Extended stats bucket aggregation
 &lt;a class="anchor" href="#extended-stats-bucket-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A sibling pipeline aggregation extending

 &lt;a href="/docs/references/aggregation/pipeline/stats-bucket/">&lt;code>stats_bucket&lt;/code>&lt;/a> with variance, standard deviation
and bounds of the per-bucket metric distribution.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: { &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } } }
 },
 &amp;#34;day_xstats&amp;#34;: { &amp;#34;extended_stats_bucket&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;per_day&amp;gt;revenue&amp;#34; } }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-extended_stats_bucket">
 Parameters for &lt;code>extended_stats_bucket&lt;/code>
 &lt;a class="anchor" href="#parameters-for-extended_stats_bucket">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, string) Path to the consumed metric.&lt;/li>
&lt;li>&lt;code>format&lt;/code> &lt;br>
(Optional, string) Output number format.&lt;/li>
&lt;li>&lt;code>gap_policy&lt;/code> &lt;br>
(Optional, string) &lt;code>skip&lt;/code> (default) or &lt;code>insert_zeros&lt;/code>.&lt;/li>
&lt;li>&lt;code>sigma&lt;/code> &lt;br>
(Optional, float, default: &lt;code>2&lt;/code>) Multiplier for the std-deviation
bounds.&lt;/li>
&lt;/ul></description></item><item><title>Percentiles bucket aggregation</title><link>/docs/references/aggregation/pipeline/percentiles-bucket/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/percentiles-bucket/</guid><description>&lt;h1 id="percentiles-bucket-aggregation">
 Percentiles bucket aggregation
 &lt;a class="anchor" href="#percentiles-bucket-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A sibling pipeline aggregation computing percentiles of a metric across
buckets — e.g. &amp;ldquo;the daily-revenue p95&amp;rdquo;.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: { &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } } }
 },
 &amp;#34;day_pcts&amp;#34;: { &amp;#34;percentiles_bucket&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;per_day&amp;gt;revenue&amp;#34; } }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-percentiles_bucket">
 Parameters for &lt;code>percentiles_bucket&lt;/code>
 &lt;a class="anchor" href="#parameters-for-percentiles_bucket">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, string) Path to the consumed metric.&lt;/li>
&lt;li>&lt;code>percents&lt;/code> &lt;br>
(Optional, number array) Percentiles to compute; defaults to
&lt;code>[1, 5, 25, 50, 75, 95, 99]&lt;/code>.&lt;/li>
&lt;li>&lt;code>format&lt;/code> &lt;br>
(Optional, string) Output number format.&lt;/li>
&lt;li>&lt;code>gap_policy&lt;/code> &lt;br>
(Optional, string) &lt;code>skip&lt;/code> (default) or &lt;code>insert_zeros&lt;/code>.&lt;/li>
&lt;/ul></description></item><item><title>Derivative aggregation</title><link>/docs/references/aggregation/pipeline/derivative/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/derivative/</guid><description>&lt;h1 id="derivative-aggregation">
 Derivative aggregation
 &lt;a class="anchor" href="#derivative-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A parent pipeline aggregation computing the &lt;strong>difference&lt;/strong> between each
bucket&amp;rsquo;s metric and the previous bucket&amp;rsquo;s — &amp;ldquo;how much did it change&amp;rdquo;.
The first bucket has no predecessor and answers &lt;code>null&lt;/code>.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } },
 &amp;#34;delta&amp;#34;: { &amp;#34;derivative&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;revenue&amp;#34; } }
 }
 }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-derivative">
 Parameters for &lt;code>derivative&lt;/code>
 &lt;a class="anchor" href="#parameters-for-derivative">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, string) Path to the consumed metric in the SAME bucket
(&lt;code>&amp;quot;revenue&amp;quot;&lt;/code>).&lt;/li>
&lt;li>&lt;code>gap_policy&lt;/code> &lt;br>
(Optional, string) &lt;code>skip&lt;/code> (default) or &lt;code>insert_zeros&lt;/code>.&lt;/li>
&lt;li>&lt;code>format&lt;/code> &lt;br>
(Optional, string) Output number format.&lt;/li>
&lt;li>&lt;code>unit&lt;/code> &lt;br>
(Optional, string) For date_histogram parents: report the derivative
per time unit (e.g. &lt;code>&amp;quot;day&amp;quot;&lt;/code>).&lt;/li>
&lt;/ul></description></item><item><title>Cumulative sum aggregation</title><link>/docs/references/aggregation/pipeline/cumulative-sum/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/cumulative-sum/</guid><description>&lt;h1 id="cumulative-sum-aggregation">
 Cumulative sum aggregation
 &lt;a class="anchor" href="#cumulative-sum-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A parent pipeline aggregation adding a &lt;strong>running total&lt;/strong> column to each
bucket — the metric plus every earlier bucket&amp;rsquo;s.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } },
 &amp;#34;running&amp;#34;: { &amp;#34;cumulative_sum&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;revenue&amp;#34; } }
 }
 }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;p>The final bucket&amp;rsquo;s &lt;code>running&lt;/code> equals the plain total (&lt;code>6750&lt;/code>).&lt;/p></description></item><item><title>Cumulative cardinality aggregation</title><link>/docs/references/aggregation/pipeline/cumulative-cardinality/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/cumulative-cardinality/</guid><description>&lt;h1 id="cumulative-cardinality-aggregation">
 Cumulative cardinality aggregation
 &lt;a class="anchor" href="#cumulative-cardinality-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A parent pipeline aggregation reporting a &lt;strong>running count of NEW
distinct values&lt;/strong> — how many unique values have been seen up to and
including each bucket.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;buyers&amp;#34;: { &amp;#34;cardinality&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;merchant&amp;#34; } },
 &amp;#34;seen_so_far&amp;#34;: { &amp;#34;cumulative_cardinality&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;buyers&amp;#34; } }
 }
 }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-cumulative_cardinality">
 Parameters for &lt;code>cumulative_cardinality&lt;/code>
 &lt;a class="anchor" href="#parameters-for-cumulative_cardinality">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, string) Path to a &lt;code>cardinality&lt;/code> metric in the same bucket.&lt;/li>
&lt;li>&lt;code>format&lt;/code> &lt;br>
(Optional, string) Output number format.&lt;/li>
&lt;/ul></description></item><item><title>Serial diff aggregation</title><link>/docs/references/aggregation/pipeline/serial-diff/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/serial-diff/</guid><description>&lt;h1 id="serial-diff-aggregation">
 Serial diff aggregation
 &lt;a class="anchor" href="#serial-diff-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A parent pipeline aggregation computing the difference between each
bucket&amp;rsquo;s metric and the bucket &lt;code>lag&lt;/code> positions back — a differencing
transform for trend analysis.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } },
 &amp;#34;wowl&amp;#34;: { &amp;#34;serial_diff&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;revenue&amp;#34;, &amp;#34;lag&amp;#34;: 2 } }
 }
 }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-serial_diff">
 Parameters for &lt;code>serial_diff&lt;/code>
 &lt;a class="anchor" href="#parameters-for-serial_diff">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, string) Path to the consumed metric in the same bucket.&lt;/li>
&lt;li>&lt;code>lag&lt;/code> &lt;br>
(Optional, integer, default: &lt;code>1&lt;/code>) How many buckets back to compare.&lt;/li>
&lt;li>&lt;code>gap_policy&lt;/code> &lt;br>
(Optional, string) &lt;code>skip&lt;/code> (default) or &lt;code>insert_zeros&lt;/code>.&lt;/li>
&lt;li>&lt;code>format&lt;/code> &lt;br>
(Optional, string) Output number format.&lt;/li>
&lt;/ul></description></item><item><title>Moving fn aggregation</title><link>/docs/references/aggregation/pipeline/moving-fn/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/moving-fn/</guid><description>&lt;h1 id="moving-fn-aggregation">
 Moving fn aggregation
 &lt;a class="anchor" href="#moving-fn-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A parent pipeline aggregation computing a &lt;strong>window statistic&lt;/strong> over the
last N buckets&amp;rsquo; metrics — &lt;code>MovingFunctions.max(values)&lt;/code>,
&lt;code>MovingFunctions.sum(values)&lt;/code>, &lt;code>MovingFunctions.min(values)&lt;/code> and
friends, with the window sliding bucket by bucket.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } },
 &amp;#34;smooth&amp;#34;: {
 &amp;#34;moving_fn&amp;#34;: {
 &amp;#34;buckets_path&amp;#34;: &amp;#34;revenue&amp;#34;,
 &amp;#34;window&amp;#34;: 3,
 &amp;#34;script&amp;#34;: &amp;#34;MovingFunctions.max(values)&amp;#34;
 }
 }
 }
 }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;p>&lt;code>moving_avg&lt;/code> is the same aggregation with a fixed averaging script.&lt;/p></description></item><item><title>Moving avg aggregation</title><link>/docs/references/aggregation/pipeline/moving-avg/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/moving-avg/</guid><description>&lt;h1 id="moving-avg-aggregation">
 Moving avg aggregation
 &lt;a class="anchor" href="#moving-avg-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A parent pipeline aggregation smoothing a metric with a &lt;strong>moving
average&lt;/strong> over the last N buckets — &lt;code>moving_fn&lt;/code> with a fixed averaging
script.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } },
 &amp;#34;smooth&amp;#34;: { &amp;#34;moving_avg&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;revenue&amp;#34;, &amp;#34;window&amp;#34;: 3 } }
 }
 }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-moving_avg">
 Parameters for &lt;code>moving_avg&lt;/code>
 &lt;a class="anchor" href="#parameters-for-moving_avg">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, string) Path to the consumed metric in the same bucket.&lt;/li>
&lt;li>&lt;code>window&lt;/code> &lt;br>
(Required, integer) Number of buckets in the sliding window.&lt;/li>
&lt;li>&lt;code>model&lt;/code> &lt;br>
(Optional, string) Averaging model; the engine evaluates a simple
mean.&lt;/li>
&lt;li>&lt;code>gap_policy&lt;/code> &lt;br>
(Optional, string) &lt;code>skip&lt;/code> (default) or &lt;code>insert_zeros&lt;/code>.&lt;/li>
&lt;/ul></description></item><item><title>Bucket script aggregation</title><link>/docs/references/aggregation/pipeline/bucket-script/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/bucket-script/</guid><description>&lt;h1 id="bucket-script-aggregation">
 Bucket script aggregation
 &lt;a class="anchor" href="#bucket-script-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A parent pipeline aggregation computing &lt;strong>arithmetic on a bucket&amp;rsquo;s own
metrics&lt;/strong> — the script references sibling metrics by name through
&lt;code>params&lt;/code> and its result becomes a new per-bucket value.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } },
 &amp;#34;orders&amp;#34;: { &amp;#34;value_count&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;price&amp;#34; } },
 &amp;#34;avg_order&amp;#34;: {
 &amp;#34;bucket_script&amp;#34;: {
 &amp;#34;buckets_path&amp;#34;: { &amp;#34;r&amp;#34;: &amp;#34;revenue&amp;#34;, &amp;#34;n&amp;#34;: &amp;#34;orders&amp;#34; },
 &amp;#34;script&amp;#34;: &amp;#34;params.r / params.n&amp;#34;
 }
 }
 }
 }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-bucket_script">
 Parameters for &lt;code>bucket_script&lt;/code>
 &lt;a class="anchor" href="#parameters-for-bucket_script">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, object) Map of script variable names to sibling metric
paths (&lt;code>{ &amp;quot;r&amp;quot;: &amp;quot;revenue&amp;quot; }&lt;/code>).&lt;/li>
&lt;li>&lt;code>script&lt;/code> &lt;br>
(Required, string) Expression over &lt;code>params.&amp;lt;name&amp;gt;&lt;/code>.&lt;/li>
&lt;li>&lt;code>format&lt;/code> &lt;br>
(Optional, string) Output number format.&lt;/li>
&lt;li>&lt;code>gap_policy&lt;/code> &lt;br>
(Optional, string) &lt;code>skip&lt;/code> (default) or &lt;code>insert_zeros&lt;/code>.&lt;/li>
&lt;/ul></description></item><item><title>Bucket selector aggregation</title><link>/docs/references/aggregation/pipeline/bucket-selector/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/bucket-selector/</guid><description>&lt;h1 id="bucket-selector-aggregation">
 Bucket selector aggregation
 &lt;a class="anchor" href="#bucket-selector-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A parent pipeline aggregation &lt;strong>filtering the bucket list itself&lt;/strong>: a
script predicate per bucket — buckets whose script evaluates false are
dropped from the response.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_day&amp;#34;: {
 &amp;#34;date_histogram&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;date&amp;#34;, &amp;#34;calendar_interval&amp;#34;: &amp;#34;day&amp;#34; },
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } },
 &amp;#34;big_days&amp;#34;: {
 &amp;#34;bucket_selector&amp;#34;: {
 &amp;#34;buckets_path&amp;#34;: { &amp;#34;r&amp;#34;: &amp;#34;revenue&amp;#34; },
 &amp;#34;script&amp;#34;: &amp;#34;params.r &amp;gt; 150&amp;#34;
 }
 }
 }
 }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-bucket_selector">
 Parameters for &lt;code>bucket_selector&lt;/code>
 &lt;a class="anchor" href="#parameters-for-bucket_selector">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, object) Map of script variable names to sibling metric
paths.&lt;/li>
&lt;li>&lt;code>script&lt;/code> &lt;br>
(Required, string) Keep predicate over &lt;code>params.&amp;lt;name&amp;gt;&lt;/code>.&lt;/li>
&lt;li>&lt;code>gap_policy&lt;/code> &lt;br>
(Optional, string) &lt;code>skip&lt;/code> (default) or &lt;code>insert_zeros&lt;/code>.&lt;/li>
&lt;/ul></description></item><item><title>Bucket sort aggregation</title><link>/docs/references/aggregation/pipeline/bucket-sort/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/bucket-sort/</guid><description>&lt;h1 id="bucket-sort-aggregation">
 Bucket sort aggregation
 &lt;a class="anchor" href="#bucket-sort-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A parent pipeline aggregation &lt;strong>sorting (and paginating)&lt;/strong> the bucket
list by any of the bucket&amp;rsquo;s metrics — the pipeline counterpart of the
request-level &lt;code>sort&lt;/code>.&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_type&amp;#34;: {
 &amp;#34;terms&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;type&amp;#34;, &amp;#34;size&amp;#34;: 10 },
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } },
 &amp;#34;by_revenue&amp;#34;: {
 &amp;#34;bucket_sort&amp;#34;: { &amp;#34;sort&amp;#34;: [ { &amp;#34;revenue&amp;#34;: { &amp;#34;order&amp;#34;: &amp;#34;asc&amp;#34; } } ] }
 }
 }
 }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-bucket_sort">
 Parameters for &lt;code>bucket_sort&lt;/code>
 &lt;a class="anchor" href="#parameters-for-bucket_sort">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>sort&lt;/code> &lt;br>
(Optional, array) Sort clauses over the bucket&amp;rsquo;s metrics
(&lt;code>[{ &amp;quot;revenue&amp;quot;: { &amp;quot;order&amp;quot;: &amp;quot;desc&amp;quot; } }]&lt;/code>).&lt;/li>
&lt;li>&lt;code>from&lt;/code> &lt;br>
(Optional, integer) Skip this many buckets — pagination offset.&lt;/li>
&lt;li>&lt;code>size&lt;/code> &lt;br>
(Optional, integer) Keep at most this many buckets.&lt;/li>
&lt;li>&lt;code>gap_policy&lt;/code> &lt;br>
(Optional, string) &lt;code>skip&lt;/code> (default) or &lt;code>insert_zeros&lt;/code>.&lt;/li>
&lt;/ul></description></item><item><title>Normalize aggregation</title><link>/docs/references/aggregation/pipeline/normalize/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/aggregation/pipeline/normalize/</guid><description>&lt;h1 id="normalize-aggregation">
 Normalize aggregation
 &lt;a class="anchor" href="#normalize-aggregation">#&lt;/a>
&lt;/h1>
&lt;p>A parent pipeline aggregation &lt;strong>rescaling&lt;/strong> a bucket metric into a
share or rank — e.g. each bucket&amp;rsquo;s revenue as a percent of the total
(&lt;code>percent_of_sum&lt;/code>).&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;per_type&amp;#34;: {
 &amp;#34;terms&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;type&amp;#34;, &amp;#34;size&amp;#34;: 5 },
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;revenue&amp;#34;: { &amp;#34;sum&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;amount&amp;#34; } },
 &amp;#34;share&amp;#34;: {
 &amp;#34;normalize&amp;#34;: { &amp;#34;buckets_path&amp;#34;: &amp;#34;revenue&amp;#34;, &amp;#34;method&amp;#34;: &amp;#34;percent_of_sum&amp;#34; }
 }
 }
 }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;h2 id="parameters-for-normalize">
 Parameters for &lt;code>normalize&lt;/code>
 &lt;a class="anchor" href="#parameters-for-normalize">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;code>buckets_path&lt;/code> &lt;br>
(Required, string) Path to the consumed metric in the same bucket.&lt;/li>
&lt;li>&lt;code>method&lt;/code> &lt;br>
(Required, string) Rescale method: &lt;code>percent_of_sum&lt;/code>, &lt;code>rescale_0_1&lt;/code>,
&lt;code>mean&lt;/code>, &lt;code>z-score&lt;/code>, &lt;code>softmax&lt;/code>.&lt;/li>
&lt;li>&lt;code>format&lt;/code> &lt;br>
(Optional, string) Output number format.&lt;/li>
&lt;/ul></description></item></channel></rss>