Merge metadata & native key expressions

Do not delegates query building to Key instance anymore.
This commit is contained in:
Mathieu Darse
2015-11-05 16:52:01 +01:00
parent 803a9010a5
commit 713442c7b4
10 changed files with 70 additions and 194 deletions

View File

@@ -2,9 +2,6 @@
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST\KeyValue;
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
use Assert\Assertion;
class NativeKey implements Key
{
const TYPE_DATABASE = 'database';
@@ -41,14 +38,9 @@ class NativeKey implements Key
$this->key = $key;
}
public function buildQueryForValue($value, QueryContext $context)
public function getIndexField()
{
Assertion::string($value);
return [
'term' => [
$this->key => $value
]
];
return $this->key;
}
public function __toString()