-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Enable default fields for Elasticsearch 6.x #11205
Conversation
Previously default_fields were only enabled for Elasticsearch 7.x. For the migration it is required that also indices from Elasticsearch 6.x have the default_field option set. This enables it for 6.x. Closes elastic#11187
I tried to find a good reason on why we enabled this only for 7.0 and not 6.x. The initial PR was done here: #7015 It could be argued that it's a breaking change as non keyword / ip fields which were directly searchable before are not searchable anymore. I "assume" before you could have typed just |
I tested this against 6.6 and it works as expected. If I run this against 6.0 I get the following error:
I think the change was applied here: elastic/elasticsearch#26320 In 6.0 default_field did not accept an array yet. To keep 6.7 compatible with 6.0 I will exclude 6.0 from setting the default_field. For the migration, we should recommend users to be on 6.7 first anyways. |
libbeat/template/template.go
Outdated
@@ -277,7 +277,7 @@ func buildIdxSettings(ver common.Version, userSettings common.MapStr) common.Map | |||
indexSettings.Put("number_of_routing_shards", defaultNumberOfRoutingShards) | |||
} | |||
|
|||
if ver.Major >= 7 { | |||
if ver.Major >= 6 { |
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.
This enables it for all 6.x ES versions. Would it be better if we check the minor version as well?
ver.Major >= 7 || (ver.Major ==6 && ver.Minor >= 7)
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.
Should have pushed by local changes. My take at the moment is that it should set it for 6.x versions except 6.0.
@urso Targetting 6.x look a good idea to me, following @joshdover this option exist since 5.6 |
Previously default_fields were only enabled for Elasticsearch 7.x. For the migration it is required that also indices from Elasticsearch 6.x have the default_field option set. This enables it for 6.x except 6.0.
Closes #11187