Problem/Motivation
In Drupal 8 and 9, we used docblock attributes to find and provide metadata about plugins. PHP 8.0 introduced annotations as a first-class language feature.
Starting with Drupal core 10.2.0, plugin types should use annotations instead of attributes. We define two plugin types, ElasticSearchAnalyser, and ElasticSearchConnector. Using annotations to define plugin types will go away in Drupal 12.
Proposed resolution
Create ElasticSearchAnalyser and ElasticSearchConnector annotations. Update our plugin managers to use annotations. Update implementations in our own code to use annotations.
Write a change record.
Remaining tasks
9.0.x merge request- merge request !218 created by @mparker17 in #28.0.x merge request- merge request !219 created by @mparker17 in #3- Community review
- Maintainer review
- Commit to 9.0.x
- Commit to 8.0.x
- Release 9.0.x
- Release 8.0.x
User interface changes
None.
API changes
Annotations are now available and recommended.
Data model changes
None.
Issue fork elasticsearch_connector-3587447
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 #4
mparker17Still need to write a change record, but the code is ready for community review!
Comment #5
mparker17Actually, wait.
The English words "analyser" and "analyzer" mean the same thing, but the first one ("analyser" with an "s") is the British-English (and presumably Australian-English) spelling; while second one ("analyzer" with a "z") the US-English spelling.
Drupal's coding standards say that names should use US English
Search API OpenSearch uses "Analyser" for both the annotations and the attributes; and @sokru and I previously agreed that we want to follow their conventions, so that site builders can easily move between the projects and the two projects can continue to exchange code, easing the maintenance burden.
In my merge requests, I have stuck with the old name ("Analyser") and old directory name ("Plugin/ElasticSearch/Analyser") but since we're introducing a new API, and if developers are going to be switching from annotations to attributes anyway, and if we're going to deprecate the old mis-spelled annotations, this is a unique opportunity to fix the spelling!
But Search API OpenSearch still uses the mis-spelled "Analyser" in both its 2.x and 3.x branches (although its 3.x branch doesn't appear to have any releases yet), so fixing the spelling in our branch would break with Search API OpenSearch. (that being said, given that it's 3.x branch hasn't been released yet, I will try to patch it and see if the maintainers are willing to accept the patch)
See also #3570041: Analyzer querytime_synonyms not working in our queue.
This issue doesn't have to block a beta release, but I'd like to get it in before a beta if I can.