From 9c973905cef142112c608886d81a988c10ddc320 Mon Sep 17 00:00:00 2001 From: Guy Owen Date: Tue, 16 Apr 2019 14:48:47 +1000 Subject: [PATCH] [SDPA-2005] Refactored ES Connector service alts. (#15) * [SDPA-2005] Refactored ES Connector service alts. * [SDPA-2005] Remove unused use statements. * [SDPA-2005] Fixed linting errors. --- .../Factory/TideSearchIndexFactory.php | 6 +++--- src/TideSearchServiceProvider.php | 21 +++++++++++++++++++ tide_search.services.yml | 3 --- 3 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 src/TideSearchServiceProvider.php delete mode 100644 tide_search.services.yml diff --git a/src/ElasticSearch/Parameters/Factory/TideSearchIndexFactory.php b/src/ElasticSearch/Parameters/Factory/TideSearchIndexFactory.php index 7d44904..da667ab 100644 --- a/src/ElasticSearch/Parameters/Factory/TideSearchIndexFactory.php +++ b/src/ElasticSearch/Parameters/Factory/TideSearchIndexFactory.php @@ -2,20 +2,20 @@ namespace Drupal\tide_search\ElasticSearch\Parameters\Factory; -use Drupal\search_api\IndexInterface; use Drupal\elasticsearch_connector\ElasticSearch\Parameters\Factory\IndexFactory; use Drupal\elasticsearch_connector\Entity\Cluster; use Drupal\search_api\Entity\Server; +use Drupal\search_api\IndexInterface; /** - * Create Elasticsearch Indices. + * Customised implementation for creation of Elasticsearch Indices. */ class TideSearchIndexFactory extends IndexFactory { const HASH_LENGTH = 32; /** - * Override the elasticsearch_connector bulk delete params. + * Overrides the elasticsearch_connector bulk delete params. * * @param \Drupal\search_api\IndexInterface $index * The Search API Index. diff --git a/src/TideSearchServiceProvider.php b/src/TideSearchServiceProvider.php new file mode 100644 index 0000000..5ab233c --- /dev/null +++ b/src/TideSearchServiceProvider.php @@ -0,0 +1,21 @@ +getDefinition('elasticsearch_connector.index_factory'); + $definition->setClass('Drupal\tide_search\ElasticSearch\Parameters\Factory\TideSearchIndexFactory'); + } + +} diff --git a/tide_search.services.yml b/tide_search.services.yml deleted file mode 100644 index 1e8fb58..0000000 --- a/tide_search.services.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - tide_search.index_factory: - class: Drupal\tide_search\ElasticSearch\Parameters\Factory\TideSearchIndexFactory