From e14c1009ee6bd74da492e95b255bdd4018cf8c2f Mon Sep 17 00:00:00 2001 From: James Baiera Date: Tue, 28 Jan 2020 14:28:31 -0500 Subject: [PATCH] Fix master test failures (#1420) --- .../spark/integration/AbstractScalaEsSpark.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spark/core/itest/scala/org/elasticsearch/spark/integration/AbstractScalaEsSpark.scala b/spark/core/itest/scala/org/elasticsearch/spark/integration/AbstractScalaEsSpark.scala index 4ed615e30..52da5f1ed 100644 --- a/spark/core/itest/scala/org/elasticsearch/spark/integration/AbstractScalaEsSpark.scala +++ b/spark/core/itest/scala/org/elasticsearch/spark/integration/AbstractScalaEsSpark.scala @@ -804,10 +804,16 @@ class AbstractScalaEsScalaSpark(prefix: String, readMetadata: jl.Boolean) extend val typename = "alias" val target = resource(index, typename, version) + val indexPattern = "spark-template-*" + val patternMatchField = if (version.onOrAfter(EsMajorVersion.V_8_X)) { + s""""index_patterns":["$indexPattern"],""" + } else { + s""""template": "$indexPattern",""" + } val template = s""" |{ - |"template" : "spark-template-*", + |$patternMatchField |"settings" : { | "number_of_shards" : 1, | "number_of_replicas" : 0