mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00

Search with non numeric content will not hit number field (it breaks elasticsearch and is useless anyway) - Rename QueryHelper::buildPrivateFieldQueries() to wrapPrivateFieldQuery(). - Signature changed too, the third parameter is dropped an QueryContext is replaced by an array of Field. - Query builder closure is now passed an array of Field, not of index field names. - Remove Field::toConceptPathIndexFieldArray() because method name was beyond understanding (and also because it wasn't needed anymore) - Various AST node types have changed due to previous API changes
27 lines
616 B
PHP
27 lines
616 B
PHP
<?php
|
|
|
|
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
|
|
|
|
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
|
|
use Alchemy\Phrasea\SearchEngine\Elastic\Thesaurus\Term;
|
|
|
|
class TermNode extends AbstractTermNode
|
|
{
|
|
public function buildQuery(QueryContext $context)
|
|
{
|
|
$query = $this->buildConceptQuery($context);
|
|
|
|
// Should not match anything if no concept is defined
|
|
if ($query === null) {
|
|
$query['bool']['should'] = [];
|
|
}
|
|
|
|
return $query;
|
|
}
|
|
|
|
public function __toString()
|
|
{
|
|
return sprintf('<term:%s>', Term::dump($this));
|
|
}
|
|
}
|