Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for constant_keyword #1373

Closed
beanaroo opened this issue Jun 16, 2020 · 5 comments · Fixed by #1456
Closed

Support for constant_keyword #1373

beanaroo opened this issue Jun 16, 2020 · 5 comments · Fixed by #1456
Labels
good first issue Good for new contributors

Comments

@beanaroo
Copy link

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.
@beanaroo
Copy link
Author

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 elastic/kibana#52635, it turns out Kibana does not yet support the type either, so it is not that useful to us at the moment.

@sethmlarson sethmlarson added the good first issue Good for new contributors label Jun 16, 2020
@sethmlarson
Copy link
Contributor

Thanks for identifying this, would you be up to creating a PR with the feature and a test case?

@beanaroo
Copy link
Author

@sethmlarson I'm definitely willing to contribute! I'll try to find some time this week.

@brainix
Copy link
Contributor

brainix commented Jun 22, 2020

@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.

@1Mark
Copy link

1Mark commented Jun 29, 2022

would be nice to have some documentation for this field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for new contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants