Files
Phraseanet/lib/Alchemy/Phrasea/SearchEngine/Elastic/AST/InExpression.php
Mathieu Darse fe7e63b3d7 QuotedTextNode don't inherit anymore from TextNode
- Quoted text do not hit the thesaurus anymore
- getTextNodes() was misleading, renamed to getTermNodes()
2015-02-25 12:22:52 +01:00

35 lines
771 B
PHP

<?php
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
class InExpression extends Node
{
protected $field;
protected $expression;
public function __construct(FieldNode $field, $expression)
{
$this->field = $field;
$this->expression = $expression;
}
public function buildQuery(QueryContext $context)
{
$fields = array($this->field->getValue());
return $this->expression->buildQuery($context->narrowToFields($fields));
}
public function getTermNodes()
{
return $this->expression->getTermNodes();
}
public function __toString()
{
return sprintf('(%s IN %s)', $this->expression, $this->field);
}
}