Skip to content

Commit

Permalink
replace refs to deprecated parameters edgeNgram + nGram (#2474)
Browse files Browse the repository at this point in the history
  • Loading branch information
samspills committed Jul 27, 2021
1 parent 5a1ea9f commit 8b19308
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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", _))
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}"""
}
}
}

0 comments on commit 8b19308

Please sign in to comment.