Files
Phraseanet/lib/Alchemy/Phrasea/SearchEngine/Elastic/Search/Query.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
693 B
PHP

<?php
namespace Alchemy\Phrasea\SearchEngine\Elastic\Search;
use Alchemy\Phrasea\SearchEngine\Elastic\AST\Node;
use Alchemy\Phrasea\SearchEngine\Elastic\AST\NullQueryNode;
use Hoa\Compiler\Llk\TreeNode;
class Query
{
private $root;
public function __construct(Node $root = null)
{
if (!$root) {
$root = new NullQueryNode();
}
$this->root = $root;
}
public function getTermNodes()
{
return $this->root->getTermNodes();
}
public function build(QueryContext $context)
{
return $this->root->buildQuery($context);
}
public function dump()
{
return $this->root->__toString();
}
}