I tried to put ignore_malformed
for the property of a field in ElasticSearch Mapping.
EClient.indices.putMapping(
{
index: 'activities',
type: 'user',
body: {
properties: {
meta: {
type: 'object',
ignore_malformed: true, // meta is dynamic
},
},
},
},
(err, res) => {
console.info('Put Mapping Error:', err);
console.info('Put Mapping Res:', res);
}
);
But I get
response: '{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Mapping definition for [meta] has unsupported parameters: [ignore_malformed : true]"}],"type":"mapper_parsing_exception","reason":"Mapping definition for [meta] has unsupported parameters: [ignore_malformed : true]"},"status":400}'
According to the documentation: ignore_malformed it should work. Is there someone who can tell me what is wrong with my codes?
The documentation written isn't accurate as discussed here. I tried experimenting with ignore_malformed parameter and found that it doesn't work with strings and object type, though it works with integer as expected. You can probably raise a ticket for elasticsearch or use the workaround discussed in this link.
try enabled: false
instead of ignore_malformed
for objects. This makes sure that this field can have an arbitrary inner structure (however it is not searchable then)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With