-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add support for constant_keyword "value" in field definition #386
Add support for constant_keyword "value" in field definition #386
Conversation
For the constant_keyword field type Elasticsearch allows for the value to be specified in the mapping. If the value is not specified in the mapping then the value is set based on the first document that is indexed. This adds support for specifying a constant_keyword "value" in a field definition. https://www.elastic.co/guide/en/elasticsearch//reference/7.12/keyword.html#constant-keyword-params Package data streams will be able to explicitly declare a constant_keyword value and will not have to include the field with every document sent. This gives packages more control over constant_keyword field values. It can be used optimize storage for an integration since you could omit the constant_keyword field entirely an event's _source. Relates: elastic/package-spec#194
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are more changes required than this as we enabled fields dependency management.
It's related to the use case I mentioned in https://github.com/elastic/package-spec/pull/194/files#r656795658 (import field definition and override some properties). If we want to enable properties overriding. We have to modify the logic calling fdm.ImportFields
(see:
func (dm *DependencyManager) ImportField(schemaName, fieldPath string) (FieldDefinition, error) { |
Good point, I'll look over the places you mention and start adding support for overriding. I can see a use-case for a field like |
@andrewkroh Do you plan to finalize this PR or split into multiple chunks? If it's ready for review, please unmark the draft mode. |
…:andrewkroh/elastic-package into feature/constant-keyword-value-field-def
I will implement the ability to set attributes for external fields in a separate PR. The issue to track this feature is #392. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it! Please also update the dependency in the elastic/integrations.
For the constant_keyword field type Elasticsearch allows for the value to be specified in the mapping.
If the value is not specified in the mapping then the value is set based on the first document that is
indexed. This adds support for specifying a constant_keyword "value" in a field definition.
Package data streams will be able to explicitly declare a
constant_keyword
value and will not have toinclude the field with every document sent. It can be used optimize storage for an integration since
you could omit the constant_keyword field entirely an event's
_source
.Depends on: elastic/package-spec#194 (this requires a spec update)
package-spec update: elastic/package-spec@b358e97