Skip to content

Commit 6a71578

Browse files
authored
fix: hidden index util to compare es version other than 7.7.X (#121)
1 parent 26a099b commit 6a71578

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

util/esclient.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ func GetSemanticVersion() string {
7575
// HiddenIndexSettings to set plugin indices as hidden index
7676
func HiddenIndexSettings() string {
7777
esVersion := GetSemanticVersion()
78-
if strings.Contains(esVersion, "7.7") {
78+
// Golang allows using comparision operators with strings
79+
// test: https://play.golang.org/p/2F36GFe3L0A
80+
if esVersion >= "7.7.0" {
7981
return `"index.hidden": true,`
8082
}
8183

0 commit comments

Comments
 (0)