1<?php
2
3namespace Elastica\Aggregation;
4
5use Elastica\Aggregation\Traits\GapPolicyTrait;
6
7/**
8 * Dealing with gaps in the data.
9 *
10 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline.html#gap-policy
11 * @see GapPolicyTrait
12 */
13interface GapPolicyInterface
14{
15    /**
16     * Treats missing data as if the bucket does not exist. It will skip the bucket and continue calculating using the next available value.
17     */
18    public const SKIP = 'skip';
19
20    /**
21     * Will replace missing values with a zero (0) and pipeline aggregation computation will proceed as normal.
22     */
23    public const INSERT_ZEROS = 'insert_zeros';
24
25    /**
26     * Is similar to skip, except if the metric provides a non-null, non-NaN value this value is used, otherwise the empty bucket is skipped.
27     */
28    public const KEEP_VALUES = 'keep_values';
29
30    /**
31     * Set the gap policy for this aggregation.
32     *
33     * @return $this
34     */
35    public function setGapPolicy(string $gapPolicy);
36}
37