mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
- Look for text nodes and infer the concepts behind term using thesaurus - Use value objects for thesaurus terms and concepts - Pass a QueryContext holding allowed fields and locales informations when building the Elasticsearch query - Change type hinting and name of query building method on nodes - Remove unused method Node#isFullTextOnly() - Move getFieldsStructure from RecordIndexer to RecordHelper for reusing field structure in SearchEngine
35 lines
771 B
PHP
35 lines
771 B
PHP
<?php
|
|
|
|
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
|
|
|
|
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
|
|
|
|
class InExpression extends Node
|
|
{
|
|
protected $field;
|
|
protected $expression;
|
|
|
|
public function __construct(FieldNode $field, $expression)
|
|
{
|
|
$this->field = $field;
|
|
$this->expression = $expression;
|
|
}
|
|
|
|
public function buildQuery(QueryContext $context)
|
|
{
|
|
$fields = array($this->field->getValue());
|
|
|
|
return $this->expression->buildQuery($context->narrowToFields($fields));
|
|
}
|
|
|
|
public function getTextNodes()
|
|
{
|
|
return $this->expression->getTextNodes();
|
|
}
|
|
|
|
public function __toString()
|
|
{
|
|
return sprintf('(%s IN %s)', $this->expression, $this->field);
|
|
}
|
|
}
|