-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
failures
field to UpdateByQueryResponse
and `DeleteByQueryRes…
…ponse` (#2896) Also update `ReindexResponse` to make its `failures` field have the same type as the one in `UpdateByQueryResponse` and `DeleteByQueryResponse`. Resolves #2883 Co-authored-by: Alex Zolotko <[email protected]> Co-authored-by: Sam <[email protected]>
- Loading branch information
1 parent
b9d39ab
commit e2a9a5b
Showing
6 changed files
with
45 additions
and
9 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/BulkIndexByScrollFailure.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,8 @@ | ||
package com.sksamuel.elastic4s | ||
|
||
// https://github.com/elastic/elasticsearch-specification/blob/b8b9d95dd6f94dc4e415d37da97095278f9a3a90/specification/_types/Errors.ts#L58 | ||
case class BulkIndexByScrollFailure(cause: ErrorCause, | ||
id: String, | ||
index: String, | ||
status: Int, | ||
`type`: String) |
23 changes: 23 additions & 0 deletions
23
elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/ErrorCause.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,23 @@ | ||
package com.sksamuel.elastic4s | ||
|
||
import com.fasterxml.jackson.annotation.{JsonAnySetter, JsonProperty} | ||
|
||
import scala.collection.mutable | ||
|
||
|
||
// https://github.com/elastic/elasticsearch-specification/blob/b8b9d95dd6f94dc4e415d37da97095278f9a3a90/specification/_types/Errors.ts#L29 | ||
case class ErrorCause(`type`: String, | ||
reason: Option[String], | ||
@JsonProperty("stack_trace") stackTrace: Option[String], | ||
@JsonProperty("caused_by") causedBy: Option[ErrorCause], | ||
@JsonProperty("root_cause") rootCause: Option[Seq[ErrorCause]], | ||
suppressed: Option[Seq[ErrorCause]]) { | ||
private val _other = mutable.HashMap[String, String]() | ||
|
||
//noinspection ScalaUnusedSymbol | ||
@JsonAnySetter private def setOther(k: String, v: String): Unit = _other.put(k, v) | ||
|
||
def other(key: String): Option[String] = _other.get(key) | ||
|
||
override def toString: String = s"ErrorCause(${`type`},$reason,${_other})" | ||
} |
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
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