From 38ffa26f9060ec79bc75ca5de19c9687d14c75b8 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Fri, 10 Apr 2020 11:54:33 +0200 Subject: [PATCH] EZP-31556: Registered Field Type as not to be indexed by search engine (#34) --- .../Resources/config/services/ezplatform.yml | 3 +- src/eZ/FieldType/Query/SearchField.php | 79 ------------------- 2 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 src/eZ/FieldType/Query/SearchField.php diff --git a/src/Symfony/Resources/config/services/ezplatform.yml b/src/Symfony/Resources/config/services/ezplatform.yml index c8df223..c0341a4 100644 --- a/src/Symfony/Resources/config/services/ezplatform.yml +++ b/src/Symfony/Resources/config/services/ezplatform.yml @@ -26,7 +26,8 @@ services: tags: - { name: ezpublish.storageEngine.legacy.converter, alias: '%ezcontentquery_identifier%' } - EzSystems\EzPlatformQueryFieldType\eZ\FieldType\Query\SearchField: + ezplatform.query_field_type.not_indexable: + class: eZ\Publish\Core\FieldType\Unindexed tags: - { name: ezpublish.fieldType.indexable, alias: '%ezcontentquery_identifier%' } diff --git a/src/eZ/FieldType/Query/SearchField.php b/src/eZ/FieldType/Query/SearchField.php deleted file mode 100644 index 76d9ba9..0000000 --- a/src/eZ/FieldType/Query/SearchField.php +++ /dev/null @@ -1,79 +0,0 @@ -value->data, - new Search\FieldType\StringField() - ), - new Search\Field( - 'fulltext', - $field->value->data, - new Search\FieldType\FullTextField() - ), - ]; - } - - /** - * Get index field types for search backend. - * - * @return \eZ\Publish\SPI\Search\FieldType[] - */ - public function getIndexDefinition() - { - return [ - 'value' => new Search\FieldType\StringField(), - ]; - } - - /** - * Get name of the default field to be used for matching. - * - * As field types can index multiple fields (see MapLocation field type's - * implementation of this interface), this method is used to define default - * field for matching. Default field is typically used by Field criterion. - * - * @return string - */ - public function getDefaultMatchField() - { - return 'value'; - } - - /** - * Get name of the default field to be used for sorting. - * - * As field types can index multiple fields (see MapLocation field type's - * implementation of this interface), this method is used to define default - * field for sorting. Default field is typically used by Field sort clause. - * - * @return string - */ - public function getDefaultSortField() - { - return $this->getDefaultMatchField(); - } -}