I have the following code:
ElasticService.delete(id) match {
case failure: RequestFailure => complete(StatusCodes.InternalServerError, failure.body.getOrElse("Unknown reason"))
case success: RequestSuccess[DeleteResponse] => {
println(s"$id Deleted")
.....
}
}
'delete' method is implemented as:
def delete(id: String): Response[DeleteResponse] = {
client.execute {
deleteById("myIndex", id)
}.await
}
This all works as expected. But if I modify match block by replacing DeleteResponse with DeleteByQueryResponse, I see that match still happens.
Why is it so? I see no hierarchical relationship between DeleteResponse and DeleteByQueryResponse.