Files
Phraseanet/lib/Alchemy/Phrasea/SearchEngine/Elastic/AST/KeyValue/MetadataKey.php
Mathieu Darse 713442c7b4 Merge metadata & native key expressions
Do not delegates query building to Key instance anymore.
2015-11-06 10:16:33 +01:00

28 lines
520 B
PHP

<?php
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST\KeyValue;
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
use Assert\Assertion;
class MetadataKey implements Key
{
private $name;
public function __construct($name)
{
Assertion::string($name);
$this->name = $name;
}
public function getIndexField()
{
return sprintf('exif.%s', $this->name);
}
public function __toString()
{
return sprintf('metadata.%s', $this->name);
}
}