I cannot find any example where dynamic templates are defined with your gem?
ref: https://www.elastic.co/guide/en/elasticsearch/guide/current/custom-dynamic-mapping.html
up
An acceptable solution for me would be to provide a simple json object or a hash for the mapping (instead of using the helpers from the gem) so I could define dynamic templates. Is there any way to "fallback" on a simple json object for the mapping configuration?
That's just an API call to Elasticsearch, so you should use the put_mapping method from the elasticsearch Rubygem.
Late to the party I know. But @adrienbourgeois it is possible:
```module MyIndex
settings index: {
max_result_window: 75_000,
} do
mapping dynamic_templates: [
{
strings: {
path_match: 'mypath.*',
match_mapping_type: 'string',
mapping: {
type: 'string',
analyzer: 'keyword',
}
}
}
] do
indexes :name, type: :string, analyzer: 'english'
end
end
end
Most helpful comment
Late to the party I know. But @adrienbourgeois it is possible:
```module MyIndex
settings index: {
max_result_window: 75_000,
} do
mapping dynamic_templates: [
{
strings: {
path_match: 'mypath.*',
match_mapping_type: 'string',
mapping: {
type: 'string',
analyzer: 'keyword',
}
}
}
] do
indexes :name, type: :string, analyzer: 'english'
end
end
end