Closed VKambulov closed 3 years ago
Hi @VKambulov, it's a good feature to add in the package. I've added it in my list.
Hi @VKambulov, sorry for taking so long. The feature is now available in v1.3.0.
$mapping->dynamicTemplate('my_template_name', [
'match_mapping_type' => 'long',
'mapping' => [
'type' => 'integer',
],
]);
Hello! I think it would be a good idea to make it possible to insert dynamic templates into migrations. For example, we have an object with a large nesting of related relations, the names of the fields and the purpose are approximately similar:
In order not to assign a keyword type to each SKU field, we could do something like this:
I have not found how to define dynamic templates in the current implementation, and judging by the code, this is not possible now, since the Mapping class works only with properties. I would suggest adding the
dynamicTemplates
function and passing an array into it, or making dynamic templates define similar to the__call
function, for example:or:
In some situations, I think dynamic templates could help a lot. Please correct me if I am wrong about something, or if this possibility already exists.
Updated: Sorry, I saw late that this is more related to Elastic Adapter.