mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 21:43:18 +00:00
BooleanOperator → BooleanExpression
This commit is contained in:
@@ -4,7 +4,7 @@ namespace Alchemy\Phrasea\SearchEngine\Elastic\AST\Boolean;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
|
||||
|
||||
class AndOperator extends BinaryOperator
|
||||
class AndExpression extends BinaryExpression
|
||||
{
|
||||
protected $operator = 'AND';
|
||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Phrasea\SearchEngine\Elastic\AST\Boolean;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\AST\Node;
|
||||
|
||||
abstract class BinaryOperator extends Node
|
||||
abstract class BinaryExpression extends Node
|
||||
{
|
||||
protected $left;
|
||||
protected $right;
|
@@ -4,7 +4,7 @@ namespace Alchemy\Phrasea\SearchEngine\Elastic\AST\Boolean;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
|
||||
|
||||
class ExceptOperator extends BinaryOperator
|
||||
class ExceptExpression extends BinaryExpression
|
||||
{
|
||||
protected $operator = 'EXCEPT';
|
||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Phrasea\SearchEngine\Elastic\AST\Boolean;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
|
||||
|
||||
class OrOperator extends BinaryOperator
|
||||
class OrExpression extends BinaryExpression
|
||||
{
|
||||
protected $operator = 'OR';
|
||||
|
@@ -125,21 +125,21 @@ class QueryVisitor implements Visit
|
||||
private function visitAndNode(Element $element)
|
||||
{
|
||||
return $this->handleBinaryExpression($element, function($left, $right) {
|
||||
return new AST\Boolean\AndOperator($left, $right);
|
||||
return new AST\Boolean\AndExpression($left, $right);
|
||||
});
|
||||
}
|
||||
|
||||
private function visitOrNode(Element $element)
|
||||
{
|
||||
return $this->handleBinaryExpression($element, function($left, $right) {
|
||||
return new AST\Boolean\OrOperator($left, $right);
|
||||
return new AST\Boolean\OrExpression($left, $right);
|
||||
});
|
||||
}
|
||||
|
||||
private function visitExceptNode(Element $element)
|
||||
{
|
||||
return $this->handleBinaryExpression($element, function($left, $right) {
|
||||
return new AST\Boolean\ExceptOperator($left, $right);
|
||||
return new AST\Boolean\ExceptExpression($left, $right);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ class QueryVisitor implements Visit
|
||||
throw new Exception('Unexpected context after non-contextualizable node');
|
||||
}
|
||||
} elseif ($node instanceof AST\Node) {
|
||||
$root = new AST\Boolean\AndOperator($root, $node);
|
||||
$root = new AST\Boolean\AndExpression($root, $node);
|
||||
} else {
|
||||
throw new Exception('Unexpected node type inside text node.');
|
||||
}
|
||||
|
Reference in New Issue
Block a user