Problem/Motivation
Elasticsearch_connector module doesn't have working test coverage and has some dead / Drupal 7 code. The architecture has some fundamental flaws.
Proposed resolution
Investigate https://drupal.org/project/search_api_opensearch as base for elasticsearch_connector. The search_api_opensearch module is rewrite of elasticsearch_connector module with following benefits:
- Synergy effects for two projects using almost the same codebase
- Clear separation of responsibilities for code
- No separate elasticsearch configurations, uses Search API.
- Uses dependency injection wherever possible
- Avoids static methods
- Has a high-level of unit and kernel test code coverage
Remaining tasks
Get the updated codeMake sure the tests passMake follow-up issues and link them to this issueWrite upgrade paths from 8.x-7.x and add test coverage for thisCommitRelease— released in 8.0.0-alpha1
User interface changes
- Remove separate Elasticsearch connector UI.
- Update the information displayed on the status report (i.e.:
hook_requirements()) - Update the information displayed in the requirements in
install.php/update.php(i.e.:hook_requirements()) - Delete the Elasticsearch-Connector-specific UI — use Search API's UI instead.
- Delete the help page, as it was not very helpful and very out-of-date.
- Delete the
administer elasticsearch connector,administer elasticsearch cluster, andadminister elasticsearch indexpermissions — use Search API's permissions instead.
API changes
- Drop
composer.jsondependency on illuminate/support - Drop
composer.jsondependency on ruflin/elastica - Add
composer.jsondependency on drupal/search_api (and add toelasticsearch_connector.info.yml) - Add
composer.jsondependency on makinacorpus/php-lucene - Add
composer.jsondependency on elasticsearch/elasticsearch - Change
composer.jsondevelopment dependencies - Delete
hook_elasticsearch_connector_load_library_options_alter()hook - Delete
hook_elasticsearch_connector_supported_data_types_alter()hook - Replaced
logger.channel.elasticsearchservice withlogger.channel.elasticsearch_connectorandlogger.channel.elasticsearch_connector_client - Replaced
elasticsearch_connector.client_managerservice withelasticsearch_connector.cluster_managerservice - Removed
elasticsearch_connector.index_factoryservice - Added services
plugin.manager.elasticsearch_connector.connector,plugin.manager.elasticsearch_connector.analyser,elasticsearch_connector.index_param_builder,elasticsearch_connector.query_sort_builder,elasticsearch_connector.query_filter_builder,elasticsearch_connector.search_param_builder,elasticsearch_connector.more_like_this_param_builder,elasticsearch_connector.facet_builder,elasticsearch_connector.query_param_builder,elasticsearch_connector.delete_param_builder,elasticsearch_connector.facet_result_parser,elasticsearch_connector.query_result_parser,elasticsearch_connector.field_mapper, andelasticsearch_connector.synonyms_subscriber - Deleted the Elasticsearch Connector Views sub-module (
elasticsearch_connector_views) — use Search API's views plugins instead.
Data model changes
- Remove
elasticsearch_connector.backend.plugin.elasticsearchconfig schema - Add
plugin.plugin_configuration.search_api_backend.elasticsearchconfig schema - Remove
elasticsearch_connector.cluster.*config schema - Add
plugin.plugin_configuration.elasticsearch_connector.basicauthschema - Add
plugin.plugin_configuration.elasticsearch_connector.standardschema - Remove
elasticsearch_connector.index.*schema
| Comment | File | Size | Author |
|---|
Issue fork elasticsearch_connector-3270464
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
sokru commentedComment #4
sokru commentedSeems like the hard blocker is the missing (?) event subscriber support. We'd need this to give examples for people updating their custom eventsubscribers when updating elasticsearch_connector from 8.x-7.x to 8.0.x
See also the upstream issue: #3296449: Event subscriber improvements
Comment #5
sokru commentedPosting WIP for upgrade path for people coming from 8.x-7.x. IMHO this should be resolved on separate issue with upgrade test coverage.
Comment #6
mparker17I intended to comment on this issue earlier: apologies for not doing so sooner.
I initially misunderstood this ticket as a proposal that we make elasticsearch_connector depend on search_api_opensearch, (which I suspected that my client would have concerns with, given that ElasticSearch and OpenSearch seem to have been evolving in different directions). But, I see from the code in the issue fork and patches that this ticket proposes that we copy as much code as makes sense from search_api_opensearch, while still keeping the two projects separate, and I'm in favor of the approach here.
This ticket does seem to have some overlap with #3279558: Support ElasticSearch 8, so I'm not sure whether to continue work in this ticket or 3279558. I had been working in #3279558 mostly because I was already working there before I knew this ticket existed.
Comment #7
sokru commentedComment #8
sokru commentedLinked the follow-up issues.
Comment #9
sokru commentedOne more follow-up issue. I'll merge this soon.
Comment #11
sokru commentedAdding credits from #3004866: Fix failing tests and run tests on DrupalCI
Comment #13
sokru commentedCreated one more follow-up, I hope all the issues from MR are now documented, if not we shall create separate issues from them. I'm merging this now, huge thanks for @mparker17 for this!
Comment #15
mparker17(hiding some old patches to make it easier to see what was completed in this issue)
(I'm cleaning up issues in the 8.0.x-dev branch as part of a big review of open issues for #3427243: Plan for 8.0.0-alpha release: thank you for your patience with me!)
Comment #17
mparker17Update the issue summary to document changes made in this ticket.