-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support versionType and pipeline parameters in reindex request (#3087)
* Add "externalgt" and "external_gt" cases * Support versionType parameter in reindex request * Support pipeline parameter in reindex request
- Loading branch information
Showing
4 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...4s-core/src/test/scala/com/sksamuel/elastic4s/requests/reindex/ReindexBuilderFnTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.sksamuel.elastic4s.requests.reindex | ||
|
||
import com.sksamuel.elastic4s.handlers.reindex.ReindexBuilderFn | ||
import com.sksamuel.elastic4s.requests.common.VersionType.ExternalGte | ||
import org.scalatest.funsuite.AnyFunSuite | ||
import org.scalatest.matchers.should.Matchers | ||
|
||
class ReindexBuilderFnTest extends AnyFunSuite with Matchers { | ||
import com.sksamuel.elastic4s.ElasticApi._ | ||
|
||
test("reindex content builder should support version type") { | ||
val req = reindex("source", "target").versionType(ExternalGte) | ||
|
||
ReindexBuilderFn(req).string shouldBe | ||
"""{"source":{"index":["source"]},"dest":{"index":"target","version_type":"external_gte"}}""".stripMargin | ||
} | ||
|
||
test("reindex content builder should support pipeline") { | ||
val req = reindex("source", "target").pipeline("my_pipeline") | ||
|
||
ReindexBuilderFn(req).string shouldBe | ||
"""{"source":{"index":["source"]},"dest":{"index":"target","pipeline":"my_pipeline"}}""".stripMargin | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters