Files
Phraseanet/lib/Alchemy/Phrasea/SearchEngine/Elastic/AST/FieldNode.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

36 lines
713 B
PHP

<?php
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
class FieldNode extends Node
{
protected $keyword;
public function __construct($keyword)
{
$this->keyword = $keyword;
}
public function getValue()
{
return $this->keyword;
}
public function buildQuery(QueryContext $context)
{
throw new \LogicException("A keyword can't be converted to a query.");
}
public function getTermNodes()
{
throw new \LogicException("A keyword can't contain text nodes.");
}
public function __toString()
{
return sprintf('<field:%s>', $this->keyword);
}
}