1<?php
2
3namespace Elastica\Processor;
4
5/**
6 * Elastica Split Processor.
7 *
8 * @author Federico Panini <fpanini@gmail.com>
9 *
10 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/split-processor.html
11 */
12class SplitProcessor extends AbstractProcessor
13{
14    use Traits\FieldTrait;
15    use Traits\IgnoreFailureTrait;
16    use Traits\IgnoreMissingTrait;
17
18    public const DEFAULT_IGNORE_MISSING_VALUE = false;
19
20    public function __construct(string $field, string $separator)
21    {
22        $this->setField($field);
23        $this->setSeparator($separator);
24    }
25
26    /**
27     * Set the separator.
28     *
29     * @return $this
30     */
31    public function setSeparator(string $separator): self
32    {
33        return $this->setParam('separator', $separator);
34    }
35}
36