| @@ 19-61 (lines=43) @@ | ||
| 16 | * |
|
| 17 | * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-containing-query.html |
|
| 18 | */ |
|
| 19 | class SpanContainingQuery implements SpanQueryInterface |
|
| 20 | { |
|
| 21 | /** |
|
| 22 | * @param SpanQueryInterface |
|
| 23 | */ |
|
| 24 | private $big; |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @param SpanQueryInterface |
|
| 28 | */ |
|
| 29 | private $little; |
|
| 30 | ||
| 31 | /** |
|
| 32 | * @param SpanQueryInterface $big |
|
| 33 | * @param SpanQueryInterface $little |
|
| 34 | */ |
|
| 35 | public function __construct(SpanQueryInterface $big, SpanQueryInterface $little) |
|
| 36 | { |
|
| 37 | $this->big = $big; |
|
| 38 | $this->little = $little; |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * {@inheritdoc} |
|
| 43 | */ |
|
| 44 | public function getType() |
|
| 45 | { |
|
| 46 | return 'span_containing'; |
|
| 47 | } |
|
| 48 | ||
| 49 | /** |
|
| 50 | * {@inheritdoc} |
|
| 51 | */ |
|
| 52 | public function toArray() |
|
| 53 | { |
|
| 54 | $out = [ |
|
| 55 | 'little' => $this->little->toArray(), |
|
| 56 | 'big' => $this->big->toArray(), |
|
| 57 | ]; |
|
| 58 | ||
| 59 | return [$this->getType() => $out]; |
|
| 60 | } |
|
| 61 | } |
|
| 62 | ||
| @@ 19-61 (lines=43) @@ | ||
| 16 | * |
|
| 17 | * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-within-query.html |
|
| 18 | */ |
|
| 19 | class SpanWithinQuery implements SpanQueryInterface |
|
| 20 | { |
|
| 21 | /** |
|
| 22 | * @param SpanQueryInterface |
|
| 23 | */ |
|
| 24 | private $big; |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @param SpanQueryInterface |
|
| 28 | */ |
|
| 29 | private $little; |
|
| 30 | ||
| 31 | /** |
|
| 32 | * @param SpanQueryInterface $big |
|
| 33 | * @param SpanQueryInterface $little |
|
| 34 | */ |
|
| 35 | public function __construct(SpanQueryInterface $big, SpanQueryInterface $little) |
|
| 36 | { |
|
| 37 | $this->big = $big; |
|
| 38 | $this->little = $little; |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * {@inheritdoc} |
|
| 43 | */ |
|
| 44 | public function getType() |
|
| 45 | { |
|
| 46 | return 'span_within'; |
|
| 47 | } |
|
| 48 | ||
| 49 | /** |
|
| 50 | * {@inheritdoc} |
|
| 51 | */ |
|
| 52 | public function toArray() |
|
| 53 | { |
|
| 54 | $out = [ |
|
| 55 | 'little' => $this->little->toArray(), |
|
| 56 | 'big' => $this->big->toArray(), |
|
| 57 | ]; |
|
| 58 | ||
| 59 | return [$this->getType() => $out]; |
|
| 60 | } |
|
| 61 | } |
|
| 62 | ||