-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elasticsearch6 implementation. #21458
Elasticsearch6 implementation. #21458
Conversation
Hi @romainruaud. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
@romainruaud @maghamed current implementation approach does not look as a robust solution to me.
It would be pretty hard if not impossible. Much better solution is to implement Elasticsearch 6 support as a new module, possibly disabled by default, old module may be deprecated as a whole when new one is ready. |
@orlangur I agree with you on some points. It's the whole Elasticsearch "abstraction" and the
We can (and we'd enjoy to) help on these topics, since we already built everything listed above in our Open Source implementation of Elasticsearch (which is widely known and used by the community, even documented in the Magento2 devdocs) : https://github.com/Smile-SA/elasticsuite But this is a huge amount of work to be done and to coordinate. And for now, Elasticsearch 5 is EOL on 03/11 : https://www.elastic.co/support/eol So the goal of this PR was to provide support of ES 6 to the community as soon as possible. Let me know how you wanna process on this PR. In any cases, I'm not sure there should be a new module "dedicated to Elasticsearch 6", or we will face the same mess on a near future when we will begin to write another module "dedicated to Elasticsearch 7" which is inheriting/extending the other one. Imho there should be only one module that always handle the latest stable version of Elasticsearch, and that remains compatible with the previous "still maintained" versions with a Deprecation mechanism based on plugins. (So for now, module should fit with ES 6, and handle ES 5 specificity with plugins). Maybe this part should even be inside Product (and more) indexing & querying should be in a separate (most agnostic as possible) modules also. Let me know, Best regards |
@romainruaud https://github.com/magento/magento2/tree/2.3-develop/app/code/Magento/Tinymce3 is a good example of approach I described. With all-in-one module it's pretty hard to determine which code parts are responsible for which Elasticsearch version and which versions are actually supported in each particular moment of time.
The same way, when It's enough if only one of |
But with such an approach you will end up with several modules actually sharing 95+% of their code, just like a big copy-paste, and will end up having to fix any issue on all of these nearly identical modules. Why would you treat supported Elasticsearch versions differently than PHP versions (or any other component) ? Supporting the latest and "old-stable" on a single module (with proper deprecation mechanism) is enough for me, and seems far easier to maintain. But we are now a bit far from the initial topic. |
Discussed with @maghamed :
I let Igor correct me if needed. Regards |
@romainruaud I agree with you that it should be only one module that supports what is still being supported. |
@CajuCLC that's not always true since software versions are maintained and upgraded by hosting companies and Magento updates are up to the end users. |
@miguelbalparda That goes back to what's the right way to maintain your app. IMHO the best way is to maintain everything update so there is minimal security risk. |
742fa8c
to
4d81048
Compare
OK @maghamed I think I updated my PR before you drop your comment on the issue :) It's now built as a separate module. Nothing altered in the old Just one point : I'm not completely aware about what to do to ensure the new module will be properly created on the Magento2 composer private repo. Feel free to ask anything you want more. Regards |
78bd12a
to
0ed7ebc
Compare
0ed7ebc
to
1332aaf
Compare
1332aaf
to
ba236f9
Compare
@romainruaud Hello. I've created simple product with sku = 'Simple product 1' http://prntscr.com/mqukzb |
@IvanPletnyov this use case does not seem to work on other Elasticsearch implementations (2.x or 5.x). So most probably, it has never worked as expected. If it's easy to fix I can have a look but unfortunately, the main topic of this PR is not to fix all existing functional bugs on Elasticsearch implementation, but rather to ensure compatibility with current stable version of ES 6. Regards |
@romainruaud Okay, thanks for the answer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, everything looks good.
@romainruaud you did a great job, and that's a great catch regarding ES6 support in Magento 2.3.1 especially taking into account that EOL of Elasticseach 5 is March 11th of 2019!
We will do our best to make this PR a part of Magento 2.3.1 release
* Return true if third party search engine is used | ||
* | ||
* @return bool | ||
* @since 100.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably this @since 100.1.0
is excessive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok fixed.
$prefix = null | ||
) { | ||
parent::__construct($scopeConfig, $clientResolver, $engineResolver, $prefix); | ||
$this->engineResolver = $engineResolver ?: ObjectManager::getInstance()->get(EngineResolverInterface::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taking into account that it's new module - we can just pass all dependencies as required.
No need to mulate backward compatibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just set them as required.
Hi @maghamed, thank you for the review. |
@romainruaud thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
Hi @romainruaud, thank you for your contribution! |
So the ES6 will be supported with version 2.3.2? Thanks romainruaud for the great work! 👍 |
@darksummenors I think Magento is working internally to make it reach the 2.3.1 release pipeline but it's out of my scope. Maybe I was too much "just-in-time" for 2.3.1 if they flagged it for the next release. Probably @maghamed can clarify this point. Regards |
@romainruaud - thanks for working on this. |
It has been added to 2.3.1 (noticed it release notes)! |
@darksummenors - also 2.2.8 |
Description (*)
Support Of Elasticsearch 6.
As discussed with @maghamed .
What have been done :
_all
field usage which is not supported anymore.Suggestions
data provider since thesuggest
endpoint of Elasticsearch is deprecated.Imho it's enough to deal with the EOL of Elasticsearch 5 and support the 6.
However, the module is quite messy actually (contains many classes and namespaces named after the supported Elasticsearch version, like
Elasticsearch5
, whenElasticsearch
is supposed to be a mixing between generic implementation and legacy 2.x).The same apply for System configuration fields which are named according to the version of the engine, which is bad imho.
Most probably, it will need a huge refactoring on next stable (2.4) :
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)