mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
32 lines
642 B
PHP
32 lines
642 B
PHP
<?php
|
|
|
|
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
|
|
|
|
class InExpression extends Node
|
|
{
|
|
protected $field;
|
|
protected $expression;
|
|
|
|
public function __construct(FieldNode $field, $expression)
|
|
{
|
|
$this->field = $field;
|
|
$this->expression = $expression;
|
|
}
|
|
|
|
public function getQuery()
|
|
{
|
|
return $this->expression->getQuery($this->field->getValue());
|
|
}
|
|
|
|
public function __toString()
|
|
{
|
|
return sprintf('(%s IN %s)', $this->expression, $this->field);
|
|
}
|
|
|
|
public function isFullTextOnly()
|
|
{
|
|
// In expressions are never full-text
|
|
return false;
|
|
}
|
|
}
|