key = $key; $this->value = $value; } public function buildQuery(QueryContext $context) { if (!$this->key->isValueCompatible($this->value, $context)) { throw new QueryException(sprintf('Value "%s" for key "%s" is not valid.', $this->value, $this->key)); } if(method_exists($this->key, "buildQuery")) { $query = $this->key->buildQuery($this->value, $context); } else { $query = [ 'term' => [ $this->key->getIndexField($context, true) => $this->value ] ]; } if ($this->key instanceof QueryPostProcessor) { return $this->key->postProcessQuery($query, $context); } return $query; } public function getTermNodes() { return array(); } public function __toString() { return sprintf('(<%s> == )', $this->key, $this->value); } }