From 7129d217f06d5347d51c51e137ea715d3320414d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R?= Date: Fri, 1 Feb 2019 09:57:51 +0100 Subject: [PATCH] EZP-29984: Fix LIKE support for * as wildcard across engines, deprecate % usage (#2517) Beyond just LIKE, this also fixes the following: * Add LegacySE search Field Criteria support for RelationList FieldType * Add LegacySE search Field Criteria support for Author FieldType * Add LegacySE search Field Criteria support for RichText FieldType * Handle 'Simple' field types when LIKE and int column as EQ, as int and LIKE does not mix well on SQL --- .../Tests/FieldType/AuthorIntegrationTest.php | 15 +- .../FieldType/DateAndTimeIntegrationTest.php | 10 + .../Tests/FieldType/DateIntegrationTest.php | 10 + .../FieldType/FileBaseIntegrationTest.php | 193 ------------------ .../FieldType/RelationBaseIntegrationTest.php | 110 ---------- .../FieldType/RelationIntegrationTest.php | 10 + .../FieldType/RelationListIntegrationTest.php | 19 +- .../RelationSearchBaseIntegrationTest.php | 22 -- .../FieldType/RichTextIntegrationTest.php | 9 - .../FieldType/SearchBaseIntegrationTest.php | 113 +++++++++- .../SearchMultivaluedBaseIntegrationTest.php | 3 + .../FieldType/SelectionIntegrationTest.php | 12 ++ .../Tests/FieldType/TimeIntegrationTest.php | 10 + .../Content/Query/Criterion/Operator.php | 6 + eZ/Publish/Core/FieldType/Author/Type.php | 21 +- eZ/Publish/Core/FieldType/BinaryBase/Type.php | 4 +- eZ/Publish/Core/FieldType/Country/Type.php | 6 +- eZ/Publish/Core/FieldType/Date/Type.php | 2 +- .../Core/FieldType/DateAndTime/Type.php | 2 +- .../Core/FieldType/EmailAddress/Type.php | 2 +- eZ/Publish/Core/FieldType/FieldType.php | 2 + eZ/Publish/Core/FieldType/Float/Type.php | 6 +- eZ/Publish/Core/FieldType/ISBN/Type.php | 2 +- eZ/Publish/Core/FieldType/Image/Type.php | 8 +- eZ/Publish/Core/FieldType/Integer/Type.php | 6 +- eZ/Publish/Core/FieldType/Keyword/Type.php | 6 +- eZ/Publish/Core/FieldType/Null/Type.php | 6 +- eZ/Publish/Core/FieldType/Page/Type.php | 15 +- eZ/Publish/Core/FieldType/Rating/Type.php | 6 +- eZ/Publish/Core/FieldType/Relation/Type.php | 2 +- .../Core/FieldType/RelationList/Type.php | 7 +- .../Core/FieldType/RichText/SearchField.php | 12 +- eZ/Publish/Core/FieldType/RichText/Type.php | 8 +- eZ/Publish/Core/FieldType/Selection/Type.php | 2 +- eZ/Publish/Core/FieldType/TextLine/Type.php | 2 +- eZ/Publish/Core/FieldType/Time/Type.php | 2 +- eZ/Publish/Core/FieldType/Url/Type.php | 6 +- eZ/Publish/Core/FieldType/User/Type.php | 2 +- .../FieldValue/Converter/AuthorConverter.php | 4 +- .../Converter/RelationListConverter.php | 2 + .../Converter/RichTextConverter.php | 4 +- .../CriterionHandler/FieldValue/Handler.php | 31 ++- .../FieldValue/Handler/Collection.php | 22 +- .../FieldValue/Handler/Simple.php | 21 +- .../legacy/criterion_handlers_common.yml | 1 + 45 files changed, 296 insertions(+), 468 deletions(-) delete mode 100644 eZ/Publish/API/Repository/Tests/FieldType/FileBaseIntegrationTest.php delete mode 100644 eZ/Publish/API/Repository/Tests/FieldType/RelationBaseIntegrationTest.php delete mode 100644 eZ/Publish/API/Repository/Tests/FieldType/RelationSearchBaseIntegrationTest.php diff --git a/eZ/Publish/API/Repository/Tests/FieldType/AuthorIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/AuthorIntegrationTest.php index 3b5f7508bac..91ed30ca4bc 100644 --- a/eZ/Publish/API/Repository/Tests/FieldType/AuthorIntegrationTest.php +++ b/eZ/Publish/API/Repository/Tests/FieldType/AuthorIntegrationTest.php @@ -138,7 +138,7 @@ public function getFieldName() public function assertFieldDataLoadedCorrect(Field $field) { $this->assertInstanceOf( - 'eZ\\Publish\\Core\\FieldType\\Author\\Value', + AuthorValue::class, $field->value ); @@ -219,7 +219,7 @@ public function getValidUpdateFieldData() public function assertUpdatedFieldDataLoadedCorrect(Field $field) { $this->assertInstanceOf( - 'eZ\\Publish\\Core\\FieldType\\Author\\Value', + AuthorValue::class, $field->value ); @@ -279,7 +279,7 @@ public function provideInvalidUpdateFieldData() public function assertCopiedFieldDataLoadedCorrectly(Field $field) { $this->assertInstanceOf( - 'eZ\\Publish\\Core\\FieldType\\Author\\Value', + AuthorValue::class, $field->value ); @@ -411,15 +411,6 @@ public function providerForTestIsNotEmptyValue() ); } - protected function checkSearchEngineSupport() - { - if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\\Publish\\API\\Repository\\Tests\\SetupFactory\\Legacy') { - $this->markTestSkipped( - "'ezauthor' field type is not searchable with Legacy Search Engine" - ); - } - } - protected function getValidSearchValueOne() { return array( diff --git a/eZ/Publish/API/Repository/Tests/FieldType/DateAndTimeIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/DateAndTimeIntegrationTest.php index bc86affd448..888c19cb347 100644 --- a/eZ/Publish/API/Repository/Tests/FieldType/DateAndTimeIntegrationTest.php +++ b/eZ/Publish/API/Repository/Tests/FieldType/DateAndTimeIntegrationTest.php @@ -30,6 +30,16 @@ public function getTypeName() return 'ezdatetime'; } + /** + * {@inheritdoc} + */ + protected function supportsLikeWildcard($value) + { + parent::supportsLikeWildcard($value); + + return false; + } + /** * Get expected settings schema. * diff --git a/eZ/Publish/API/Repository/Tests/FieldType/DateIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/DateIntegrationTest.php index 6ccf5fcd1d5..7f24a2888fd 100644 --- a/eZ/Publish/API/Repository/Tests/FieldType/DateIntegrationTest.php +++ b/eZ/Publish/API/Repository/Tests/FieldType/DateIntegrationTest.php @@ -31,6 +31,16 @@ public function getTypeName() return 'ezdate'; } + /** + * {@inheritdoc} + */ + protected function supportsLikeWildcard($value) + { + parent::supportsLikeWildcard($value); + + return false; + } + /** * Get expected settings schema. * diff --git a/eZ/Publish/API/Repository/Tests/FieldType/FileBaseIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/FileBaseIntegrationTest.php deleted file mode 100644 index 55b99a1cf74..00000000000 --- a/eZ/Publish/API/Repository/Tests/FieldType/FileBaseIntegrationTest.php +++ /dev/null @@ -1,193 +0,0 @@ -getConfigValue('ezpublish.kernel.root_dir'); - self::$storageDir = $this->getConfigValue(static::$storageDirConfigKey); - self::$ioRootDir = $this->getConfigValue('io_root_dir'); - - self::setUpIgnoredPath($this->getConfigValue('ignored_storage_files')); - } - } - - /** - * Tears down the test. - * - * Cleans up the storage directory, if it was used - */ - public static function tearDownAfterClass() - { - parent::tearDownAfterClass(); - self::cleanupStorageDir(); - } - - /** - * Returns an iterator over the full storage dir. - * - * @return \Iterator - */ - protected static function getStorageDirIterator() - { - return new RecursiveIteratorIterator( - new RecursiveDirectoryIterator( - self::$installDir . DIRECTORY_SEPARATOR . self::$storageDir, - FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::SKIP_DOTS | FilesystemIterator::CURRENT_AS_FILEINFO - ), - RecursiveIteratorIterator::CHILD_FIRST - ); - } - - /** - * Removes the given directory path recursively. - */ - protected static function cleanupStorageDir() - { - if (self::$installDir == null || self::$storageDir == null || self::$leaveStorageData) { - // Nothing to do - return; - } - - try { - $iterator = self::getStorageDirIterator(); - - foreach ($iterator as $path => $fileInfo) { - if ($fileInfo->isDir()) { - if (!self::isIgnoredPath(dirname($path))) { - rmdir($path); - } - } elseif (!self::isIgnoredPath($path)) { - unlink($path); - } - } - } catch (UnexpectedValueException $e) { - // The directory to cleanup just doesn't exist - } - } - - protected static function setUpIgnoredPath($ignoredFiles) - { - foreach ($ignoredFiles as $ignoredFile) { - // Note: do not use here DIRECTORY_SEPARATOR - $ignoredFiles list comes from yaml settings - $pathPartsArray = explode('/', $ignoredFile); - foreach ($pathPartsArray as $index => $directoryPart) { - if ($directoryPart == '') { - continue; - } - $partPath = implode( - DIRECTORY_SEPARATOR, - array_slice($pathPartsArray, 0, $index + 1) - ); - self::$ignoredPathList[realpath($partPath)] = true; - } - } - } - - /** - * Checks if $path must be excluded from filesystem cleanup. - * - * @param string $path - * - * @return bool - */ - protected static function isIgnoredPath($path) - { - return isset(self::$ignoredPathList[realpath($path)]); - } - - protected function uriExistsOnIO($uri) - { - $spiId = str_replace(self::$storageDir, '', ltrim($uri, '/')); - $path = self::$ioRootDir . '/' . $spiId; - - return file_exists($path); - } -} diff --git a/eZ/Publish/API/Repository/Tests/FieldType/RelationBaseIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/RelationBaseIntegrationTest.php deleted file mode 100644 index f69c92c6a7d..00000000000 --- a/eZ/Publish/API/Repository/Tests/FieldType/RelationBaseIntegrationTest.php +++ /dev/null @@ -1,110 +0,0 @@ -createContent($this->getValidCreationFieldData()); - - $this->assertEquals( - $this->normalizeRelations( - $this->getCreateExpectedRelations($content) - ), - $this->normalizeRelations( - $this->getRepository()->getContentService()->loadRelations($content->versionInfo) - ) - ); - } - - /** - * Tests relation processing on field update. - */ - public function testUpdateContentRelationsProcessedCorrect() - { - $content = $this->updateContent($this->getValidUpdateFieldData()); - - $this->assertEquals( - $this->normalizeRelations( - $this->getUpdateExpectedRelations($content) - ), - $this->normalizeRelations( - $this->getRepository()->getContentService()->loadRelations($content->versionInfo) - ) - ); - } - - /** - * Normalizes given $relations for easier comparison. - * - * @param \eZ\Publish\Core\Repository\Values\Content\Relation[] $relations - * - * @return \eZ\Publish\Core\Repository\Values\Content\Relation[] - */ - protected function normalizeRelations(array $relations) - { - usort( - $relations, - function (Relation $a, Relation $b) { - if ($a->type == $b->type) { - return $a->destinationContentInfo->id < $b->destinationContentInfo->id ? 1 : -1; - } - - return $a->type < $b->type ? 1 : -1; - } - ); - $normalized = array_map( - function (Relation $relation) { - $newRelation = new Relation( - array( - 'id' => null, - 'sourceFieldDefinitionIdentifier' => $relation->sourceFieldDefinitionIdentifier, - 'type' => $relation->type, - 'sourceContentInfo' => $relation->sourceContentInfo, - 'destinationContentInfo' => $relation->destinationContentInfo, - ) - ); - - return $newRelation; - }, - $relations - ); - - return $normalized; - } -} diff --git a/eZ/Publish/API/Repository/Tests/FieldType/RelationIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/RelationIntegrationTest.php index 2d04cad1d5d..4dfe3f6d863 100644 --- a/eZ/Publish/API/Repository/Tests/FieldType/RelationIntegrationTest.php +++ b/eZ/Publish/API/Repository/Tests/FieldType/RelationIntegrationTest.php @@ -33,6 +33,16 @@ public function getTypeName() return 'ezobjectrelation'; } + /** + * {@inheritdoc} + */ + protected function supportsLikeWildcard($value) + { + parent::supportsLikeWildcard($value); + + return false; + } + /** * @param \eZ\Publish\API\Repository\Values\Content\Content $content * diff --git a/eZ/Publish/API/Repository/Tests/FieldType/RelationListIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/RelationListIntegrationTest.php index b05e839d27e..3c8af460575 100644 --- a/eZ/Publish/API/Repository/Tests/FieldType/RelationListIntegrationTest.php +++ b/eZ/Publish/API/Repository/Tests/FieldType/RelationListIntegrationTest.php @@ -34,6 +34,16 @@ public function getTypeName() return 'ezobjectrelationlist'; } + /** + * {@inheritdoc} + */ + protected function supportsLikeWildcard($value) + { + parent::supportsLikeWildcard($value); + + return false; + } + /** * @param \eZ\Publish\API\Repository\Values\Content\Content $content * @@ -407,15 +417,6 @@ public function providerForTestIsNotEmptyValue() ); } - protected function checkSearchEngineSupport() - { - if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\\Publish\\API\\Repository\\Tests\\SetupFactory\\Legacy') { - $this->markTestSkipped( - "'ezobjectrelationlist' field type is not searchable with Legacy Search Engine" - ); - } - } - protected function getValidSearchValueOne() { return array(11); diff --git a/eZ/Publish/API/Repository/Tests/FieldType/RelationSearchBaseIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/RelationSearchBaseIntegrationTest.php deleted file mode 100644 index 76c32b76bfb..00000000000 --- a/eZ/Publish/API/Repository/Tests/FieldType/RelationSearchBaseIntegrationTest.php +++ /dev/null @@ -1,22 +0,0 @@ -getSetupFactory()), '\\') === 'eZ\\Publish\\API\\Repository\\Tests\\SetupFactory\\Legacy') { - $this->markTestSkipped( - "'ezrichtext' field type is not searchable with Legacy Search Engine" - ); - } - } - protected function getValidSearchValueOne() { return <<getSetupFactory() instanceof LegacyElasticsearch) { + $this->markTestSkipped('Elasticsearch Search Engine does not support Field Criterion LIKE'); + } + + return !is_numeric($value) && !is_bool($value); + } + /** * Used to control test execution by search engine. + * + * WARNING: Using this will block testing on a given search engine for FieldType, if partial limited on LegacySE use: + * checkCustomFieldsSupport(), checkFullTextSupport(), supportsLikeWildcard(), $legacyUnsupportedOperators, (...). */ protected function checkSearchEngineSupport() { @@ -231,19 +253,15 @@ protected function checkSearchEngineSupport() protected function checkCustomFieldsSupport() { - if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\\Publish\\API\\Repository\\Tests\\SetupFactory\\Legacy') { - $this->markTestSkipped( - 'Legacy Search Engine does not support custom fields' - ); + if (get_class($this->getSetupFactory()) === Legacy::class) { + $this->markTestSkipped('Legacy Search Engine does not support custom fields'); } } protected function checkLocationFieldSearchSupport() { if ($this->getSetupFactory() instanceof LegacyElasticsearch) { - $this->markTestSkipped( - 'Elasticsearch Search Engine does not support custom fields' - ); + $this->markTestSkipped('Elasticsearch Search Engine does not support custom fields'); } } @@ -1057,6 +1075,87 @@ public function testFindNotContainsTwo($valueOne, $valueTwo, $filter, $content, $this->assertFindResult($context, $criteria, true, false, $filter, $content, $modifyField); } + /** + * Tests search with LIKE operator, with NO wildcard. + * + * @dataProvider findProvider + * @depends testCreateTestContent + */ + public function testFindLikeOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) + { + // (in case test is skipped for current search engine) + $this->supportsLikeWildcard($valueOne); + + $criteria = new Field('data', Operator::LIKE, $valueOne); + + $this->assertFindResult($context, $criteria, true, false, $filter, $content, $modifyField); + } + + /** + * Tests search with LIKE operator, with wildcard at the end (on strings). + * + * @dataProvider findProvider + * @depends testCreateTestContent + */ + public function testFindNotLikeOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) + { + if ($this->supportsLikeWildcard($valueOne)) { + $valueOne = substr_replace($valueOne, '*', -1, 1); + } + + $criteria = new LogicalNot( + new Field('data', Operator::LIKE, $valueOne) + ); + + $this->assertFindResult($context, $criteria, false, true, $filter, $content, $modifyField); + } + + /** + * Tests search with LIKE operator, with wildcard at the start (on strings). + * + * @dataProvider findProvider + * @depends testCreateTestContent + */ + public function testFindLikeTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) + { + if ($this->supportsLikeWildcard($valueTwo)) { + $valueTwo = substr_replace($valueTwo, '*', 1, 1); + } + + $criteria = new Field('data', Operator::LIKE, $valueTwo); + + $this->assertFindResult($context, $criteria, false, true, $filter, $content, $modifyField); + + // BC support for "%" for Legacy Storage engine only + // @deprecated In 6.13.x/7.3.x and higher, to be removed in 8.0 + if (!$this->supportsLikeWildcard($valueTwo) || get_class($this->getSetupFactory()) !== Legacy::class) { + return; + } + + $criteria = new Field('data', Operator::LIKE, substr_replace($valueTwo, '%', 1, 1)); + + $this->assertFindResult($context, $criteria, false, true, $filter, $content, $modifyField); + } + + /** + * Tests search with LIKE operator, with wildcard in the middle (on strings). + * + * @dataProvider findProvider + * @depends testCreateTestContent + */ + public function testFindNotLikeTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) + { + if ($this->supportsLikeWildcard($valueTwo)) { + $valueTwo = substr_replace($valueTwo, '*', 2, 1); + } + + $criteria = new LogicalNot( + new Field('data', Operator::LIKE, $valueTwo) + ); + + $this->assertFindResult($context, $criteria, true, false, $filter, $content, $modifyField); + } + /** * Sets given custom field $fieldName on a Field criteria. * diff --git a/eZ/Publish/API/Repository/Tests/FieldType/SearchMultivaluedBaseIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/SearchMultivaluedBaseIntegrationTest.php index b8c5d6063c3..98cfc9c9dab 100644 --- a/eZ/Publish/API/Repository/Tests/FieldType/SearchMultivaluedBaseIntegrationTest.php +++ b/eZ/Publish/API/Repository/Tests/FieldType/SearchMultivaluedBaseIntegrationTest.php @@ -96,6 +96,9 @@ protected function getAdditionallyIndexedMultivaluedFieldData() return array(); } + /** + * @var array Overload per FieldType on what is supported. + */ protected $legacyUnsupportedOperators = array( Operator::EQ => 'EQ', Operator::IN => 'IN', diff --git a/eZ/Publish/API/Repository/Tests/FieldType/SelectionIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/SelectionIntegrationTest.php index 502b93e34b0..28f975f6af7 100644 --- a/eZ/Publish/API/Repository/Tests/FieldType/SelectionIntegrationTest.php +++ b/eZ/Publish/API/Repository/Tests/FieldType/SelectionIntegrationTest.php @@ -29,6 +29,18 @@ public function getTypeName() return 'ezselection'; } + /** + * {@inheritdoc} + * + * If Selection is improved to be able to index + search for string also with LegacySearch, then adapt this too. + */ + protected function supportsLikeWildcard($value) + { + parent::supportsLikeWildcard($value); + + return false; + } + /** * Get expected settings schema. * diff --git a/eZ/Publish/API/Repository/Tests/FieldType/TimeIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/TimeIntegrationTest.php index c09104bc60c..377731b1086 100644 --- a/eZ/Publish/API/Repository/Tests/FieldType/TimeIntegrationTest.php +++ b/eZ/Publish/API/Repository/Tests/FieldType/TimeIntegrationTest.php @@ -30,6 +30,16 @@ public function getTypeName() return 'eztime'; } + /** + * {@inheritdoc} + */ + protected function supportsLikeWildcard($value) + { + parent::supportsLikeWildcard($value); + + return false; + } + /** * Get expected settings schema. * diff --git a/eZ/Publish/API/Repository/Values/Content/Query/Criterion/Operator.php b/eZ/Publish/API/Repository/Values/Content/Query/Criterion/Operator.php index 6954d8eee11..0591a84e06d 100644 --- a/eZ/Publish/API/Repository/Values/Content/Query/Criterion/Operator.php +++ b/eZ/Publish/API/Repository/Values/Content/Query/Criterion/Operator.php @@ -22,6 +22,12 @@ abstract class Operator const LTE = '<='; const IN = 'in'; const BETWEEN = 'between'; + + /** + * Does a lookup where a the value _can_ contain a "*" (a wildcard) in order to match a pattern. + * + * E.g: $criterion->value = "Oper*or"; + */ const LIKE = 'like'; const CONTAINS = 'contains'; } diff --git a/eZ/Publish/Core/FieldType/Author/Type.php b/eZ/Publish/Core/FieldType/Author/Type.php index bf526db5067..50194529714 100644 --- a/eZ/Publish/Core/FieldType/Author/Type.php +++ b/eZ/Publish/Core/FieldType/Author/Type.php @@ -85,22 +85,29 @@ protected function checkValueStructure(BaseValue $value) if (!$value->authors instanceof AuthorCollection) { throw new InvalidArgumentType( '$value->authors', - 'eZ\\Publish\\Core\\FieldType\\Author\\AuthorCollection', + AuthorCollection::class, $value->authors ); } } /** - * Returns information for FieldValue->$sortKey relevant to the field type. - * - * @param \eZ\Publish\Core\FieldType\Author\Value $value - * - * @return array + * {@inheritdoc} */ protected function getSortInfo(BaseValue $value) { - return false; + if (empty($value->authors)) { + return false; + } + + $authors = []; + foreach ($value->authors as $author) { + $authors[] = $this->transformationProcessor->transformByGroup($author->name, 'lowercase'); + } + + sort($authors); + + return implode(',', $authors); } /** diff --git a/eZ/Publish/Core/FieldType/BinaryBase/Type.php b/eZ/Publish/Core/FieldType/BinaryBase/Type.php index 2cf50eb9495..5d50684205e 100644 --- a/eZ/Publish/Core/FieldType/BinaryBase/Type.php +++ b/eZ/Publish/Core/FieldType/BinaryBase/Type.php @@ -148,11 +148,11 @@ protected function completeValue(BaseValue $value) } /** - * BinaryBase does not support sorting. + * BinaryBase does not support sorting, yet. * * @param \eZ\Publish\Core\FieldType\BinaryBase\Value $value * - * @return bool + * @return mixed */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/Country/Type.php b/eZ/Publish/Core/FieldType/Country/Type.php index 74d935bc30b..2c8fb46aeda 100644 --- a/eZ/Publish/Core/FieldType/Country/Type.php +++ b/eZ/Publish/Core/FieldType/Country/Type.php @@ -162,11 +162,7 @@ public function validate(FieldDefinition $fieldDefinition, SPIValue $fieldValue) } /** - * Returns information for FieldValue->$sortKey relevant to the field type. - * - * @param \eZ\Publish\Core\FieldType\Country\Value $value - * - * @return array + * {@inheritdoc} */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/Date/Type.php b/eZ/Publish/Core/FieldType/Date/Type.php index 26f4a3d6c3f..8ca9f1b3955 100644 --- a/eZ/Publish/Core/FieldType/Date/Type.php +++ b/eZ/Publish/Core/FieldType/Date/Type.php @@ -122,7 +122,7 @@ protected function checkValueStructure(BaseValue $value) * * @param \eZ\Publish\Core\FieldType\Date\Value $value * - * @return array + * @return mixed */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/DateAndTime/Type.php b/eZ/Publish/Core/FieldType/DateAndTime/Type.php index 3ab95f3f8ea..2c46721b7a5 100644 --- a/eZ/Publish/Core/FieldType/DateAndTime/Type.php +++ b/eZ/Publish/Core/FieldType/DateAndTime/Type.php @@ -132,7 +132,7 @@ protected function checkValueStructure(BaseValue $value) * * @param \eZ\Publish\Core\FieldType\DateAndTime\Value $value * - * @return array + * @return int|null */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/EmailAddress/Type.php b/eZ/Publish/Core/FieldType/EmailAddress/Type.php index 958bd22d50a..1bfc18ba30c 100644 --- a/eZ/Publish/Core/FieldType/EmailAddress/Type.php +++ b/eZ/Publish/Core/FieldType/EmailAddress/Type.php @@ -166,7 +166,7 @@ protected function checkValueStructure(BaseValue $value) * * @param \eZ\Publish\Core\FieldType\EmailAddress\Value $value * - * @return array + * @return string */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/FieldType.php b/eZ/Publish/Core/FieldType/FieldType.php index 329aec63cf8..725d4e63feb 100644 --- a/eZ/Publish/Core/FieldType/FieldType.php +++ b/eZ/Publish/Core/FieldType/FieldType.php @@ -263,6 +263,8 @@ public function applyDefaultSettings(&$fieldSettings) * For the legacy storage it is up to the field converters to set this * value in either sort_key_string or sort_key_int. * + * In case of multi value, values should be string and separated by "-" or ",". + * * @param \eZ\Publish\Core\FieldType\Value $value * * @return mixed diff --git a/eZ/Publish/Core/FieldType/Float/Type.php b/eZ/Publish/Core/FieldType/Float/Type.php index dcdedb725a9..293c1ae6ca3 100644 --- a/eZ/Publish/Core/FieldType/Float/Type.php +++ b/eZ/Publish/Core/FieldType/Float/Type.php @@ -227,11 +227,7 @@ protected function checkValueStructure(BaseValue $value) } /** - * Returns information for FieldValue->$sortKey relevant to the field type. - * - * @param \eZ\Publish\Core\FieldType\Float\Value $value - * - * @return array + * {@inheritdoc} */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/ISBN/Type.php b/eZ/Publish/Core/FieldType/ISBN/Type.php index 0add53037ed..078aa054355 100644 --- a/eZ/Publish/Core/FieldType/ISBN/Type.php +++ b/eZ/Publish/Core/FieldType/ISBN/Type.php @@ -180,7 +180,7 @@ public function validate(FieldDefinition $fieldDefinition, SPIValue $fieldValue) * * @param \eZ\Publish\Core\FieldType\ISBN\Value $value * - * @return array + * @return string */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/Image/Type.php b/eZ/Publish/Core/FieldType/Image/Type.php index 284146338fe..aea4e7669c7 100644 --- a/eZ/Publish/Core/FieldType/Image/Type.php +++ b/eZ/Publish/Core/FieldType/Image/Type.php @@ -264,13 +264,7 @@ public function validateValidatorConfiguration($validatorConfiguration) } /** - * @see \eZ\Publish\Core\FieldType::getSortInfo() - * - * @todo Correct? - * - * @param \eZ\Publish\Core\FieldType\Image\Value $value - * - * @return bool + * {@inheritdoc} */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/Integer/Type.php b/eZ/Publish/Core/FieldType/Integer/Type.php index 8b43b97b820..53d31f55e93 100644 --- a/eZ/Publish/Core/FieldType/Integer/Type.php +++ b/eZ/Publish/Core/FieldType/Integer/Type.php @@ -229,11 +229,7 @@ protected function checkValueStructure(BaseValue $value) } /** - * Returns information for FieldValue->$sortKey relevant to the field type. - * - * @param \eZ\Publish\Core\FieldType\Integer\Value $value - * - * @return array + * {@inheritdoc} */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/Keyword/Type.php b/eZ/Publish/Core/FieldType/Keyword/Type.php index a9815258348..13a4f7b88d2 100644 --- a/eZ/Publish/Core/FieldType/Keyword/Type.php +++ b/eZ/Publish/Core/FieldType/Keyword/Type.php @@ -96,11 +96,7 @@ protected function checkValueStructure(BaseValue $value) } /** - * Returns information for FieldValue->$sortKey relevant to the field type. - * - * @param \eZ\Publish\Core\FieldType\Keyword\Value $value - * - * @return array + * {@inheritdoc} */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/Null/Type.php b/eZ/Publish/Core/FieldType/Null/Type.php index b8247af717d..2c2c5d80199 100644 --- a/eZ/Publish/Core/FieldType/Null/Type.php +++ b/eZ/Publish/Core/FieldType/Null/Type.php @@ -97,11 +97,7 @@ protected function checkValueStructure(BaseValue $value) } /** - * Returns information for FieldValue->$sortKey relevant to the field type. - * - * @param \eZ\Publish\Core\FieldType\Null\Value $value - * - * @return array + * {@inheritdoc} */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/Page/Type.php b/eZ/Publish/Core/FieldType/Page/Type.php index c94e8b285ff..072a1994ea0 100644 --- a/eZ/Publish/Core/FieldType/Page/Type.php +++ b/eZ/Publish/Core/FieldType/Page/Type.php @@ -202,20 +202,7 @@ public function toPersistenceValue(SPIValue $value) } /** - * Returns information for FieldValue->$sortKey relevant to the field type. - * - * Return value is mixed. It should be something which is sensible for - * sorting. - * - * It is up to the persistence implementation to handle those values. - * Common string and integer values are safe. - * - * For the legacy storage it is up to the field converters to set this - * value in either sort_key_string or sort_key_int. - * - * @param \eZ\Publish\Core\FieldType\Page\Value $value - * - * @return mixed + * {@inheritdoc} */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/Rating/Type.php b/eZ/Publish/Core/FieldType/Rating/Type.php index bb752a3c010..34b8482fe81 100644 --- a/eZ/Publish/Core/FieldType/Rating/Type.php +++ b/eZ/Publish/Core/FieldType/Rating/Type.php @@ -103,11 +103,7 @@ protected function checkValueStructure(BaseValue $value) } /** - * Returns information for FieldValue->$sortKey relevant to the field type. - * - * @param \eZ\Publish\Core\FieldType\Rating\Value $value - * - * @return array + * {@inheritdoc} */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/Relation/Type.php b/eZ/Publish/Core/FieldType/Relation/Type.php index 63af124b527..a1cd8301e2c 100644 --- a/eZ/Publish/Core/FieldType/Relation/Type.php +++ b/eZ/Publish/Core/FieldType/Relation/Type.php @@ -204,7 +204,7 @@ protected function checkValueStructure(BaseValue $value) * * @param \eZ\Publish\Core\FieldType\Relation\Value $value * - * @return mixed + * @return string */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/RelationList/Type.php b/eZ/Publish/Core/FieldType/RelationList/Type.php index 4eab5e71659..0c8ccfe920c 100644 --- a/eZ/Publish/Core/FieldType/RelationList/Type.php +++ b/eZ/Publish/Core/FieldType/RelationList/Type.php @@ -216,15 +216,16 @@ protected function checkValueStructure(BaseValue $value) /** * Returns information for FieldValue->$sortKey relevant to the field type. - * For this FieldType, the related object's name is returned. + * + * For this FieldType, the related objects IDs are returned, separated by ",". * * @param \eZ\Publish\Core\FieldType\RelationList\Value $value * - * @return array + * @return string */ protected function getSortInfo(BaseValue $value) { - return false; + return implode(',', $value->destinationContentIds); } /** diff --git a/eZ/Publish/Core/FieldType/RichText/SearchField.php b/eZ/Publish/Core/FieldType/RichText/SearchField.php index cf8947eb422..ec7f57b4126 100644 --- a/eZ/Publish/Core/FieldType/RichText/SearchField.php +++ b/eZ/Publish/Core/FieldType/RichText/SearchField.php @@ -36,7 +36,7 @@ public function getIndexData(Field $field, FieldDefinition $fieldDefinition) return array( new Search\Field( 'value', - $this->extractShortText($document), + self::extractShortText($document), new Search\FieldType\StringField() ), new Search\Field( @@ -72,13 +72,16 @@ private function extractText(DOMNode $node) /** * Extracts short text content of the given $document. * + * @internal Only for use by RichText FieldType itself. + * * @param \DOMDocument $document * * @return string */ - private function extractShortText(DOMDocument $document) + public static function extractShortText(DOMDocument $document) { $result = null; + // try to extract first paragraph/tag if ($section = $document->documentElement->firstChild) { $textDom = $section->firstChild; @@ -93,7 +96,10 @@ private function extractShortText(DOMDocument $document) $result = $document->documentElement->textContent; } - return trim($result); + // In case of newlines, extract first line. Also limit size to 255 which is maxsize on sql impl. + $lines = preg_split('/\r\n|\n|\r/', trim($result), -1, PREG_SPLIT_NO_EMPTY); + + return empty($lines) ? '' : trim(mb_substr($lines[0], 0, 255)); } /** diff --git a/eZ/Publish/Core/FieldType/RichText/Type.php b/eZ/Publish/Core/FieldType/RichText/Type.php index 0fa2d8e41f7..3ed67f1d227 100644 --- a/eZ/Publish/Core/FieldType/RichText/Type.php +++ b/eZ/Publish/Core/FieldType/RichText/Type.php @@ -271,17 +271,15 @@ public function validate(FieldDefinition $fieldDefinition, SPIValue $value) } /** - * Returns sortKey information. - * - * @see \eZ\Publish\Core\FieldType + * Returns information for FieldValue->$sortKey relevant to the field type. * * @param \eZ\Publish\Core\FieldType\RichText\Value $value * - * @return array|bool + * @return string|null */ protected function getSortInfo(BaseValue $value) { - return false; + return SearchField::extractShortText($value->xml); } /** diff --git a/eZ/Publish/Core/FieldType/Selection/Type.php b/eZ/Publish/Core/FieldType/Selection/Type.php index 581247c3472..844345bbf30 100644 --- a/eZ/Publish/Core/FieldType/Selection/Type.php +++ b/eZ/Publish/Core/FieldType/Selection/Type.php @@ -220,7 +220,7 @@ public function validate(FieldDefinition $fieldDefinition, SPIValue $fieldValue) * * @param \eZ\Publish\Core\FieldType\Selection\Value $value * - * @return array + * @return string */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/TextLine/Type.php b/eZ/Publish/Core/FieldType/TextLine/Type.php index 3c5fe114cde..5e8a30a3253 100644 --- a/eZ/Publish/Core/FieldType/TextLine/Type.php +++ b/eZ/Publish/Core/FieldType/TextLine/Type.php @@ -206,7 +206,7 @@ protected function checkValueStructure(BaseValue $value) * * @param \eZ\Publish\Core\FieldType\TextLine\Value $value * - * @return array + * @return string */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/Time/Type.php b/eZ/Publish/Core/FieldType/Time/Type.php index 649f90c4f72..6aa3814b4c3 100644 --- a/eZ/Publish/Core/FieldType/Time/Type.php +++ b/eZ/Publish/Core/FieldType/Time/Type.php @@ -128,7 +128,7 @@ protected function checkValueStructure(BaseValue $value) * * @param \eZ\Publish\Core\FieldType\Time\Value $value * - * @return array + * @return int */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/Url/Type.php b/eZ/Publish/Core/FieldType/Url/Type.php index c70cf4fe9a5..9fffe4c9c95 100644 --- a/eZ/Publish/Core/FieldType/Url/Type.php +++ b/eZ/Publish/Core/FieldType/Url/Type.php @@ -100,11 +100,7 @@ protected function checkValueStructure(BaseValue $value) } /** - * Returns information for FieldValue->$sortKey relevant to the field type. - * - * @param \eZ\Publish\Core\FieldType\Url\Value $value - * - * @return array + * {@inheritdoc} */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/FieldType/User/Type.php b/eZ/Publish/Core/FieldType/User/Type.php index 5fe35b7417f..3cb8887b1a7 100644 --- a/eZ/Publish/Core/FieldType/User/Type.php +++ b/eZ/Publish/Core/FieldType/User/Type.php @@ -105,7 +105,7 @@ protected function checkValueStructure(BaseValue $value) } /** - * Returns information for FieldValue->$sortKey relevant to the field type. + * {@inheritdoc} */ protected function getSortInfo(BaseValue $value) { diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/AuthorConverter.php b/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/AuthorConverter.php index e439269bb53..ead798c0bd8 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/AuthorConverter.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/AuthorConverter.php @@ -40,6 +40,7 @@ public static function create() public function toStorageValue(FieldValue $value, StorageFieldValue $storageFieldValue) { $storageFieldValue->dataText = $this->generateXmlString($value->data); + $storageFieldValue->sortKeyString = $value->sortKey; } /** @@ -51,6 +52,7 @@ public function toStorageValue(FieldValue $value, StorageFieldValue $storageFiel public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue) { $fieldValue->data = $this->restoreValueFromXmlString($value->dataText); + $fieldValue->sortKey = $value->sortKeyString; } /** @@ -86,7 +88,7 @@ public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefin */ public function getIndexColumn() { - return false; + return 'sort_key_string'; } /** diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/RelationListConverter.php b/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/RelationListConverter.php index b3183c14c53..355dc3e8140 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/RelationListConverter.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/RelationListConverter.php @@ -77,6 +77,7 @@ public function toStorageValue(FieldValue $value, StorageFieldValue $storageFiel $doc->appendChild($root); $storageFieldValue->dataText = $doc->saveXML(); + $storageFieldValue->sortKeyString = $value->sortKey; } /** @@ -106,6 +107,7 @@ public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue) asort($priorityByContentId, SORT_NUMERIC); $fieldValue->data['destinationContentIds'] = array_keys($priorityByContentId); + $fieldValue->sortKey = $value->sortKeyString; } /** diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/RichTextConverter.php b/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/RichTextConverter.php index 319fa91b539..9b6b8deda00 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/RichTextConverter.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/RichTextConverter.php @@ -40,6 +40,7 @@ public static function create() public function toStorageValue(FieldValue $value, StorageFieldValue $storageFieldValue) { $storageFieldValue->dataText = $value->data; + $storageFieldValue->sortKeyString = $value->sortKey; } /** @@ -51,6 +52,7 @@ public function toStorageValue(FieldValue $value, StorageFieldValue $storageFiel public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue) { $fieldValue->data = $value->dataText ?: Value::EMPTY_VALUE; + $fieldValue->sortKey = $value->sortKeyString; } /** @@ -86,6 +88,6 @@ public function toFieldDefinition(StorageFieldDefinition $storageDefinition, Fie */ public function getIndexColumn() { - return false; + return 'sort_key_string'; } } diff --git a/eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler.php b/eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler.php index 51a7aa476b9..999477ae563 100644 --- a/eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler.php +++ b/eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler.php @@ -40,7 +40,6 @@ abstract class Handler CriterionOperator::GTE => 'gte', CriterionOperator::LT => 'lt', CriterionOperator::LTE => 'lte', - CriterionOperator::LIKE => 'like', ); /** @@ -81,15 +80,15 @@ public function handle(SelectQuery $query, Criterion $criterion, $column) case Criterion\Operator::IN: $filter = $query->expr->in( $column, - array_map(array($this, 'lowercase'), $criterion->value) + array_map(array($this, 'lowerCase'), $criterion->value) ); break; case Criterion\Operator::BETWEEN: $filter = $query->expr->between( $column, - $query->bindValue($this->lowercase($criterion->value[0])), - $query->bindValue($this->lowercase($criterion->value[1])) + $query->bindValue($this->lowerCase($criterion->value[0])), + $query->bindValue($this->lowerCase($criterion->value[1])) ); break; @@ -98,11 +97,29 @@ public function handle(SelectQuery $query, Criterion $criterion, $column) case Criterion\Operator::GTE: case Criterion\Operator::LT: case Criterion\Operator::LTE: - case Criterion\Operator::LIKE: $operatorFunction = $this->comparatorMap[$criterion->operator]; $filter = $query->expr->$operatorFunction( $column, - $query->bindValue($this->lowercase($criterion->value)) + $query->bindValue($this->lowerCase($criterion->value)) + ); + break; + + case Criterion\Operator::LIKE: + if (strpos($criterion->value, '%') !== false) { + // @deprecated In 6.13.x/7.3.x and higher, to be removed in 8.0 + @trigger_error( + "Usage of '%' in Operator::LIKE criteria with Legacy Search Engine was never intended, " . + "and is deprecated for removal in 8.0. Please use '*' like in FullText, works across engines", + E_USER_DEPRECATED + ); + $value = $this->lowerCase($criterion->value); + } else { + $value = str_replace('*', '%', $this->prepareLikeString($criterion->value)); + } + + $filter = $query->expr->like( + $column, + $query->bindValue($value) ); break; @@ -133,7 +150,7 @@ public function handle(SelectQuery $query, Criterion $criterion, $column) */ protected function prepareLikeString($string) { - return addcslashes($this->lowercase($string), '%_'); + return addcslashes($this->lowerCase($string), '%_'); } /** diff --git a/eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Collection.php b/eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Collection.php index b3ef2d73a3b..6aea74bc0f3 100644 --- a/eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Collection.php +++ b/eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Collection.php @@ -55,13 +55,31 @@ public function __construct(DatabaseHandler $dbHandler, TransformationProcessor */ public function handle(SelectQuery $query, Criterion $criterion, $column) { + $singleValueExpr = 'eq'; + switch ($criterion->operator) { + case Criterion\Operator::LIKE: + if (strpos($criterion->value, '%') !== false) { + // @deprecated In 6.13.x/7.3.x and higher, to be removed in 8.0 + @trigger_error( + "Usage of '%' in Operator::LIKE criteria with Legacy Search Engine was never intended, " . + "and is deprecated for removal in 8.0. Please use '*' like in FullText, works across engines", + E_USER_DEPRECATED + ); + $value = $this->lowerCase($criterion->value); + } else { + // Allow usage of * as wildcards in ::LIKE + $value = str_replace('*', '%', $this->prepareLikeString($criterion->value)); + } + $singleValueExpr = 'like'; + // No break here, rest is handled by shared code with ::CONTAINS below + case Criterion\Operator::CONTAINS: + $value = isset($value) ? $value : $this->prepareLikeString($criterion->value); $quotedColumn = $this->dbHandler->quoteColumn($column); - $value = $this->prepareLikeString($criterion->value); $filter = $query->expr->lOr( array( - $query->expr->eq( + $query->expr->$singleValueExpr( $quotedColumn, $query->bindValue($value, null, \PDO::PARAM_STR) ), diff --git a/eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Simple.php b/eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Simple.php index 2cf2ec91320..fa02f78ea7e 100644 --- a/eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Simple.php +++ b/eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Simple.php @@ -31,16 +31,17 @@ class Simple extends Handler */ public function handle(SelectQuery $query, Criterion $criterion, $column) { - switch ($criterion->operator) { - case Criterion\Operator::CONTAINS: - $filter = $query->expr->eq( - $this->dbHandler->quoteColumn($column), - $query->bindValue($this->lowerCase($criterion->value)) - ); - break; - - default: - $filter = parent::handle($query, $criterion, $column); + // For "Simple" FieldTypes, handle the following as equal: + // - Contains + // - LIKE when against int column + if ($criterion->operator === Criterion\Operator::CONTAINS || + ($criterion->operator === Criterion\Operator::LIKE && $column === 'sort_key_int')) { + $filter = $query->expr->eq( + $this->dbHandler->quoteColumn($column), + $query->bindValue($this->lowerCase($criterion->value)) + ); + } else { + $filter = parent::handle($query, $criterion, $column); } return $filter; diff --git a/eZ/Publish/Core/settings/search_engines/legacy/criterion_handlers_common.yml b/eZ/Publish/Core/settings/search_engines/legacy/criterion_handlers_common.yml index d391d19719a..2c5587b2c8e 100644 --- a/eZ/Publish/Core/settings/search_engines/legacy/criterion_handlers_common.yml +++ b/eZ/Publish/Core/settings/search_engines/legacy/criterion_handlers_common.yml @@ -249,6 +249,7 @@ services: arguments: - , tags: + - {name: ezpublish.search.legacy.gateway.criterion_field_value_handler, alias: ezauthor} - {name: ezpublish.search.legacy.gateway.criterion_field_value_handler, alias: ezcountry} - {name: ezpublish.search.legacy.gateway.criterion_field_value_handler, alias: ezobjectrelationlist} - {name: ezpublish.search.legacy.gateway.criterion_field_value_handler, alias: ezkeyword}