Description
Summary (*)
Magento 2.3.2
As a developer, I need to develop a custom module that affects the search functionality. This requires extra data to be indexed in elasticsearch. This module requires an extra dynamic template sent to the elasticsearch server in the mappings.
Examples (*)
in version 2.3.2, the mappings are sent via Magento\Elasticsearch6\Model\Client\Elasticsearch::addFieldsMapping
(or any other models that can be used as elasticsearch clients depending on elasticsearch version)
And the dynamic templates are hardocded
'dynamic_templates' => [
[
'price_mapping' => [
'match' => 'price_*',
'match_mapping_type' => 'string',
'mapping' => [
'type' => 'float',
'store' => true,
],
],
],
....
The value cannot be changed via plugins, because the value is sent to elasticsearch as soon as it it built. The method that actually sends the mappings $this->getClient()->indices()->putMapping($params);
cannot be pluginized because the object that is being called is not created via Object manager.
Proposed solution
A method that just returns an empty array in the elasticsearch client. The result of this method is merged with the mappings sent to elasticsearch before sending them. This method can be pluginized by third party modules.
This will not break backwards compatibility.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status