mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Check type of field before considering it a Date
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Alchemy\Phrasea\SearchEngine\Elastic\Search;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\AST;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Exception\Exception;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Mapping;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Structure\Structure;
|
||||
use Hoa\Compiler\Llk\TreeNode;
|
||||
use Hoa\Visitor\Element;
|
||||
@@ -207,7 +208,7 @@ class QueryVisitor implements Visit
|
||||
if ($key instanceof AST\KeyValue\TimestampKey) {
|
||||
return true;
|
||||
} elseif ($key instanceof AST\KeyValue\FieldKey) {
|
||||
return $this->structure->get($key->getName()) !== null;
|
||||
return $this->structure->typeOf($key->getName()) === Mapping::TYPE_DATE;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user