When trying to add a field of type constant_keyword to a Mapping, an exception is returned:
DSL class `constant_keyword` does not exist in field.
Creating a custom field using:
class ConstantKeyword(Keyword):
name = 'constant_keyword'
and then
mapping.field('service_name', ConstantKeyword(value=svc_name))
Seems to result in the correct mapping being applied. Not sure if this is the right way to do it.
From https://github.com/elastic/kibana/issues/52635, it turns out Kibana does not yet support the type either, so it is not that useful to us at the moment.
Thanks for identifying this, would you be up to creating a PR with the feature and a test case?
@sethmlarson I'm definitely willing to contribute! I'll try to find some time this week.
@beanaroo - I'm also willing to help! It's your find, so I'll let you take the lead on this. But if you want my help (or if you can't find time to whip up a PR), feel free to ping me.
Most helpful comment
@sethmlarson I'm definitely willing to contribute! I'll try to find some time this week.