mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00

- Quoted text do not hit the thesaurus anymore - getTextNodes() was misleading, renamed to getTermNodes()
36 lines
713 B
PHP
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);
|
|
}
|
|
}
|