Put flags in ES structure

This commit is contained in:
Mathieu Darse
2015-09-28 20:27:29 +02:00
parent 8b87e94ff2
commit 4424d43b18
14 changed files with 232 additions and 52 deletions

View File

@@ -6,6 +6,7 @@ use Alchemy\Phrasea\SearchEngine\Elastic\Exception\QueryException;
use Alchemy\Phrasea\SearchEngine\Elastic\Mapping;
use Alchemy\Phrasea\SearchEngine\Elastic\Structure\Field;
use Alchemy\Phrasea\SearchEngine\Elastic\AST\Field as ASTField;
use Alchemy\Phrasea\SearchEngine\Elastic\AST\Flag;
use Alchemy\Phrasea\SearchEngine\Elastic\Structure\Structure;
/**
@@ -73,11 +74,15 @@ class QueryContext
if ($name instanceof ASTField) {
$name = $name->getValue();
}
$field = $this->structure->get($name);
if (!$field) {
return null;
return $this->structure->get($name);
}
public function getFlag($name)
{
if ($name instanceof Flag) {
$name = $name->getName();
}
return $field;
return $this->structure->getFlagByName($name);
}
/**