1 | <?php |
||
8 | abstract class AbstractTermsAggregation extends AbstractSimpleAggregation |
||
9 | { |
||
10 | use Traits\ShardSizeTrait; |
||
11 | |||
12 | public const EXECUTION_HINT_MAP = 'map'; |
||
13 | public const EXECUTION_HINT_GLOBAL_ORDINALS = 'global_ordinals'; |
||
14 | |||
15 | /** |
||
16 | * Set the minimum number of documents in which a term must appear in order to be returned in a bucket. |
||
17 | * |
||
18 | * @return $this |
||
19 | */ |
||
20 | public function setMinimumDocumentCount(int $count): self |
||
24 | |||
25 | /** |
||
26 | * Filter documents to include based on a regular expression. |
||
27 | * |
||
28 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/regexp-syntax.html for syntax |
||
29 | * |
||
30 | * @param string $pattern a regular expression, following the Regexp syntax |
||
31 | * |
||
32 | * @return $this |
||
33 | */ |
||
34 | public function setInclude(string $pattern): self |
||
38 | |||
39 | /** |
||
40 | * Filter documents to include based on a list of exact values. |
||
41 | * |
||
42 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#_filtering_values_with_exact_values_2 |
||
43 | * |
||
44 | * @param string[] $values |
||
45 | * |
||
46 | * @return $this |
||
47 | */ |
||
48 | public function setIncludeAsExactMatch(array $values): self |
||
52 | |||
53 | /** |
||
54 | * Set the aggregation filter to use partitions. |
||
55 | * |
||
56 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#_filtering_values_with_partitions |
||
57 | * |
||
58 | * @return $this |
||
59 | */ |
||
60 | public function setIncludeWithPartitions(int $partition, int $numPartitions): self |
||
67 | |||
68 | /** |
||
69 | * Filter documents to exclude based on a regular expression. |
||
70 | * |
||
71 | * @param string $pattern a regular expression |
||
72 | * |
||
73 | * @return $this |
||
74 | */ |
||
75 | public function setExclude(string $pattern): self |
||
79 | |||
80 | /** |
||
81 | * Filter documents to exclude based on a list of exact values. |
||
82 | * |
||
83 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#_filtering_values_with_exact_values_2 |
||
84 | * |
||
85 | * @param string[] $values |
||
86 | * |
||
87 | * @return $this |
||
88 | */ |
||
89 | public function setExcludeAsExactMatch(array $values): self |
||
93 | |||
94 | /** |
||
95 | * Sets the amount of terms to be returned. |
||
96 | * |
||
97 | * @return $this |
||
98 | */ |
||
99 | public function setSize(int $size): self |
||
103 | |||
104 | /** |
||
105 | * Instruct Elasticsearch to use direct field data or ordinals of the field values to execute this aggregation. |
||
106 | * The execution hint will be ignored if it is not applicable. |
||
107 | * |
||
108 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-execution-hint |
||
109 | * |
||
110 | * @param string $hint Execution hint, use one of self::EXECUTION_HINT_MAP or self::EXECUTION_HINT_GLOBAL_ORDINALS |
||
111 | * |
||
112 | * @return $this |
||
113 | */ |
||
114 | public function setExecutionHint(string $hint): self |
||
118 | } |
||
119 |