$shape
*/
public function __construct(
private string $field,
private array $shape,
private string $relation = 'intersects',
private bool|null $ignoreUnmapped = null,
)
{
if ( ! \in_array($relation, ['intersects', 'disjoint', 'within', 'contains'], true)) {
throw new \Spameri\ElasticQuery\Exception\InvalidArgumentException(
'Shape relation must be one of: intersects, disjoint, within, contains.',
);
}
}
public function key(): string
{
return 'shape_' . $this->field;
}
/**
* @return array