Skip to content
Snippets Groups Projects
QueryMatch.php 431 B
Newer Older
<?php

declare(strict_types=1);

Nikita Chernykh's avatar
Nikita Chernykh committed
namespace IQDEV\ElasticSearch\Criteria\Match;

use IQDEV\ElasticSearch\Esable;

class QueryMatch implements Esable
{
    public function __construct(
        private readonly string $key,
Pavel's avatar
Pavel committed
        private readonly mixed $value,
    ) {
    }

    public function es(): array
    {
        return [
            $this->key => [
                'query' => $this->value
            ]
        ];
    }
}