| @@ 12-45 (lines=34) @@ | ||
| 9 | * |
|
| 10 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/append-processor.html |
|
| 11 | */ |
|
| 12 | class AppendProcessor extends AbstractProcessor |
|
| 13 | { |
|
| 14 | /** |
|
| 15 | * @param string $field field name |
|
| 16 | * @param array|string $value field values to append |
|
| 17 | */ |
|
| 18 | public function __construct(string $field, $value) |
|
| 19 | { |
|
| 20 | $this->setField($field); |
|
| 21 | $this->setValue($value); |
|
| 22 | } |
|
| 23 | ||
| 24 | /** |
|
| 25 | * Set field. |
|
| 26 | * |
|
| 27 | * @return $this |
|
| 28 | */ |
|
| 29 | public function setField(string $field): self |
|
| 30 | { |
|
| 31 | return $this->setParam('field', $field); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * Set field value. |
|
| 36 | * |
|
| 37 | * @param array|string $value |
|
| 38 | * |
|
| 39 | * @return $this |
|
| 40 | */ |
|
| 41 | public function setValue($value): self |
|
| 42 | { |
|
| 43 | return $this->setParam('value', $value); |
|
| 44 | } |
|
| 45 | } |
|
| 46 | ||
| @@ 12-39 (lines=28) @@ | ||
| 9 | * |
|
| 10 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/join-processor.html |
|
| 11 | */ |
|
| 12 | class JoinProcessor extends AbstractProcessor |
|
| 13 | { |
|
| 14 | public function __construct(string $field, string $separator) |
|
| 15 | { |
|
| 16 | $this->setField($field); |
|
| 17 | $this->setSeparator($separator); |
|
| 18 | } |
|
| 19 | ||
| 20 | /** |
|
| 21 | * Set the field. |
|
| 22 | * |
|
| 23 | * @return $this |
|
| 24 | */ |
|
| 25 | public function setField(string $field): self |
|
| 26 | { |
|
| 27 | return $this->setParam('field', $field); |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * Set the separator. |
|
| 32 | * |
|
| 33 | * @return $this |
|
| 34 | */ |
|
| 35 | public function setSeparator(string $separator): self |
|
| 36 | { |
|
| 37 | return $this->setParam('separator', $separator); |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||