For the 8.0.x release series, we decided to largely mirror the structure of the code in the Search API OpenSearch module, in order to make both projects more maintainable. See #3270464: Investigate search_api_opensearch as base for elasticsearch_connector for more information.
Following the Search API OpenSearch module's structure allows us to more-easily share code between both projects, and makes it easier for Elasticsearch Connector users to build on other innovations in the Search API ecosystem. However, resulted in many changes from elasticsearch_connector:8.x-7.0-alpha6.
Hooks
hook_elasticsearch_connector_supported_data_types_alter()
The hook_elasticsearch_connector_supported_data_types_alter() hook is used to modify the list of supported data types in the elasticsearch_connector:8.x-7.x release series. But, it has been deprecated in elasticsearch_connector:8.x-7.0-alpha6 and has been removed from elasticsearch_connector:8.0.0. To modify the list of supported data types, Elasticsearch Connector 8.0.0 instead uses the Search API module's data types.
See the full hook_elasticsearch_connector_supported_data_types_alter change record for more information.
hook_elasticsearch_connector_load_library_options_alter()
The hook_elasticsearch_connector_load_library_options_alter() hook is used to modify the connector library options in the elasticsearch_connector:8.x-7.x release series. But, it has been deprecated in elasticsearch_connector:8.x-7.0-alpha6 and has been removed from elasticsearch_connector:8.0.0. To modify the connector library options, Elasticsearch Connector 8.0.0 uses Drupal's plugin API to define connection types.
See the full hook_elasticsearch_connector_load_library_options_alter() change record for more information.
elasticsearch_connector_views submodule
Elasticsearch Connector 8.0.0 provides out-of-box superb Views integration with many features with test coverage.
Events
BuildIndexParamsEvent
The \Drupal\elasticsearch_connector\Event\BuildIndexParamsEvent event is used to allow other modules to alter index params before they are sent.
@todo
BuildSearchParamsEvent
The \Drupal\elasticsearch_connector\Event\BuildSearchParamsEvent event is used to allow other modules to alter search parameters before a query is created.
A similar event in the 8.0.x and 9.0.x release series' is \Drupal\elasticsearch_connector\Event\AlterSearchQueryParamsEvent
@todo
PrepareIndexEvent
The \Drupal\elasticsearch_connector\Event\PrepareIndexEvent event is used to allow other modules to alter index configuration before an index is created.
The 8.0.x branch has two events that run when an index is created:
\Drupal\elasticsearch_connector\Event\IndexPreCreateEvent, which runs before the index is created, and\Drupal\elasticsearch_connector\Event\IndexCreatedEvent, which runs after the index is created
In some use-cases, AlterSettingsEvent might also work for you, see #3433226: Add index to AlterSettingsEvent for backward compatibility.
| Elasticsearch Connector 8.x-7.x code | Elasticsearch Connector 8.0.x code |
|---|---|
|
Old code in |
New code in |
PrepareIndexMappingEvent
The \Drupal\elasticsearch_connector\Event\PrepareIndexMappingEvent event is used to allow other modules to alter index mapping configuration before it is saved.
@todo
PrepareMappingEvent
The \Drupal\elasticsearch_connector\Event\PrepareMappingEvent event is used to allow other modules to alter mapping configuration before it is saved.
@todo \Drupal\elasticsearch_connector\Event\FieldMappingEvent is an equivalent?
PrepareSearchQueryEvent
The \Drupal\elasticsearch_connector\Event\PrepareSearchQueryEvent event is used to allow other modules to alter search queries before they are sent.
@todo
Services
elasticsearch_connector.client_factory
The elasticsearch_connector.client_factory service and its class \nodespark\DESConnector\ClientFactory has been deprecated in elasticsearch_connector:8.x-7.0-alpha6 and has been removed from elasticsearch_connector:8.0.0. @todo
elasticsearch_connector.client_manager
The elasticsearch_connector.client_manager service and its class \Drupal\elasticsearch_connector\ElasticSearch\ClientManager has been deprecated in elasticsearch_connector:8.x-7.0-alpha6 and has been removed from elasticsearch_connector:8.0.0. @todo
elasticsearch_connector.cluster_manager
The elasticsearch_connector.cluster_manager service and its class \Drupal\elasticsearch_connector\ClusterManager has been deprecated in elasticsearch_connector:8.x-7.0-alpha6 and has been removed from elasticsearch_connector:8.0.0. @todo
elasticsearch_connector.index_factory
The elasticsearch_connector.index_factory service and its class \Drupal\elasticsearch_connector\ElasticSearch\Parameters\Factory\IndexFactory has been deprecated in elasticsearch_connector:8.x-7.0-alpha6 and has been removed from elasticsearch_connector:8.0.0. @todo
Other classes
Many classes that were present in elasticsearch_connector:8.x-7.0-alpha6 were removed. The full list of classes removed in elasticsearch_connector:8.0.0 is:
- modules/elasticsearch_connector_views/src/Plugin/views/ElasticsearchViewsHandlerTrait.php
- modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsBoolean.php
- modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsDate.php
- modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsEntity.php
- modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsEntityField.php
- modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsFieldTrait.ph
- modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsMarkup.php
- modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsNumeric.php
- modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsStandard.php
- modules/elasticsearch_connector_views/src/Plugin/views/filter/ElasticsearchViewsBooleanOperator.php
- modules/elasticsearch_connector_views/src/Plugin/views/filter/ElasticsearchViewsDate.php
- modules/elasticsearch_connector_views/src/Plugin/views/filter/ElasticsearchViewsFulltextSearch.php
- modules/elasticsearch_connector_views/src/Plugin/views/filter/ElasticsearchViewsNumericFilte.php
- modules/elasticsearch_connector_views/src/Plugin/views/filter/ElasticsearchViewsStandard.php
- modules/elasticsearch_connector_views/src/Plugin/views/filter/ElasticsearchViewsStringFilter.php
- modules/elasticsearch_connector_views/src/Plugin/views/join/ElasticsearchViewsJoin.php
- modules/elasticsearch_connector_views/src/Plugin/views/query/ElasticsearchViewsQuery.php
- src/ClusterManager.php
- src/Controller/ClusterListBuilder.php
- src/Controller/ElasticsearchController.php
- src/ElasticSearch/ClientManager.php
- src/ElasticSearch/ClientManagerInterface.php
- src/ElasticSearch/Parameters/Builder/SearchBuilder.php
- src/ElasticSearch/Parameters/Factory/FilterFactory.php
- src/ElasticSearch/Parameters/Factory/IndexFactory.php
- src/ElasticSearch/Parameters/Factory/MappingFactory.php
- src/ElasticSearch/Parameters/Factory/SearchFactory.php
- src/Entity/Cluster.php
- src/Entity/ClusterRouteProvider.php
- src/Entity/Index.php
- src/Entity/IndexRouteProvider.php
- src/Event/BuildIndexParamsEvent.php
- src/Event/BuildSearchParamsEvent.php
- src/Event/PrepareIndexEvent.php
- src/Event/PrepareIndexMappingEvent.php
- src/Event/PrepareMappingEvent.php
- src/Event/PrepareSearchQueryEvent.php
- src/Exception/ElasticSearchConnectorException.php
- src/Form/ClusterDeleteForm.php
- src/Form/ClusterForm.php
- src/Form/IndexDeleteForm.php
- src/Form/IndexForm.php
- src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php
- src/Plugin/search_api/backend/SearchApiElasticsearchBackendInterface.php
- src/Plugin/search_api/processor/ExcludeSourceFields.php
(note that this list excludes test classes)