diff --git a/elastic4s-core/src/main/scala/com/sksamuel/elastic4s/analysis/TokenFilter.scala b/elastic4s-core/src/main/scala/com/sksamuel/elastic4s/analysis/TokenFilter.scala index 7707f750f..75c57edfd 100644 --- a/elastic4s-core/src/main/scala/com/sksamuel/elastic4s/analysis/TokenFilter.scala +++ b/elastic4s-core/src/main/scala/com/sksamuel/elastic4s/analysis/TokenFilter.scala @@ -341,7 +341,7 @@ case class EdgeNGramTokenFilter(override val name: String, override def build: XContentBuilder = { val b = XContentFactory.jsonBuilder() - b.field("type", "edgeNGram") + b.field("type", "edge_ngram") b.field("min_gram", minGram) b.field("max_gram", maxGram) side.foreach(b.field("side", _)) @@ -361,7 +361,7 @@ case class NGramTokenFilter(override val name: String, override def build: XContentBuilder = { val b = XContentFactory.jsonBuilder() - b.field("type", "nGram") + b.field("type", "ngram") minGram.foreach(b.field("min_gram", _)) maxGram.foreach(b.field("max_gram", _)) b diff --git a/elastic4s-core/src/main/scala/com/sksamuel/elastic4s/analysis/Tokenizer.scala b/elastic4s-core/src/main/scala/com/sksamuel/elastic4s/analysis/Tokenizer.scala index bfe7dfc09..1637c7f18 100644 --- a/elastic4s-core/src/main/scala/com/sksamuel/elastic4s/analysis/Tokenizer.scala +++ b/elastic4s-core/src/main/scala/com/sksamuel/elastic4s/analysis/Tokenizer.scala @@ -104,7 +104,7 @@ case class EdgeNGramTokenizer(override val name: String, override def build: XContentBuilder = { val b = XContentFactory.jsonBuilder() - b.field("type", "edgeNGram") + b.field("type", "edge_ngram") b.field("min_gram", minGram) b.field("max_gram", maxGram) if (tokenChars.nonEmpty) diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/tokenizers/EdgeNGramTokenizerBuilderTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/tokenizers/EdgeNGramTokenizerBuilderTest.scala index 06c5073c2..3fac0d488 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/tokenizers/EdgeNGramTokenizerBuilderTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/analysis/tokenizers/EdgeNGramTokenizerBuilderTest.scala @@ -9,7 +9,7 @@ class EdgeNGramTokenizerBuilderTest extends AnyWordSpec with Matchers with Elast "EdgeNGramTokenizer" should { "build json" in { - EdgeNGramTokenizer("testy").minMaxGrams(2, 3).tokenChars("a", "z").build.string shouldBe """{"type":"edgeNGram","min_gram":2,"max_gram":3,"token_chars":["a","z"]}""" + EdgeNGramTokenizer("testy").minMaxGrams(2, 3).tokenChars("a", "z").build.string shouldBe """{"type":"edge_ngram","min_gram":2,"max_gram":3,"token_chars":["a","z"]}""" } } }