Many thanks
I think that it could be the expected configuration:
{
"mappings": { "my_type": {
"dynamic_templates": [
{
"booleans": {
"match_mapping_type": "boolean",
"mapping": {
"type": "string"
}
}
},
{
"dates": {
"match_mapping_type": "date",
"mapping": {
"type": "string"
}
}
},
{
"doubles": {
"match_mapping_type": "double",
"mapping": {
"type": "string"
}
}
},
{
"longs": {
"match_mapping_type": "long",
"mapping": {
"type": "string"
}
}
}
]
}
}
}
But now, I have another problem when the tag could be a simple type or an object, for example:
<a>
<b>1234</b>
<b myAttr="attrValue">crash!</b>
</a>
- If you see, the first "a.b" tag, its simple value is 1234 but the mapper will use the type String.
- The problem is in the second tag "a.b", because the content is a "object" due to the internal attribute. Then, when I launch the application I see the following exception:
MapperParsingException[Merging dynamic updates triggered a conflict: mapper [a.b] of different type, current_type [string], merged_type [ObjectMapper]]
If I redefine the previous configuration and I add the "object" as "String":
{
"objects": {
"match_mapping_type": "object",
"mapping": {
"type": "string"
}
}
I will get the following exception:
MapperParsingException[failed to parse [a]]; nested: IllegalArgumentException[unknown property [b]];
When I use a simple XML like this:
<a><b>hello</b></a>
Any other idea?
Many thanks.
Regards,
Paco.