Skip to content

Commit

Permalink
Merge ed278fe into 8379603
Browse files Browse the repository at this point in the history
  • Loading branch information
szajbus committed Nov 12, 2019
2 parents 8379603 + ed278fe commit e2e531e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/elasticsearch.ex
Expand Up @@ -394,12 +394,13 @@ defmodule Elasticsearch do
status: 404, type: "index_not_found_exception"}}
"""
@spec delete(Cluster.t(), url) :: response
@spec delete(Cluster.t(), url, opts) :: response
def delete(cluster, url, opts \\ []) do
@spec delete(Cluster.t(), url, data) :: response
@spec delete(Cluster.t(), url, data, opts) :: response
def delete(cluster, url, data \\ "", opts \\ []) do
config = Config.get(cluster)

config
|> config.api.request(:delete, url, "", opts)
|> config.api.request(:delete, url, data, opts)
|> format()
end

Expand All @@ -418,10 +419,11 @@ defmodule Elasticsearch do
** (Elasticsearch.Exception) (index_not_found_exception) no such index
"""
@spec delete!(Cluster.t(), url) :: map | no_return
@spec delete!(Cluster.t(), url, opts) :: map | no_return
def delete!(cluster, url, opts \\ []) do
@spec delete!(Cluster.t(), url, data) :: map | no_return
@spec delete!(Cluster.t(), url, data, opts) :: map | no_return
def delete!(cluster, url, data \\ "", opts \\ []) do
cluster
|> delete(url, opts)
|> delete(url, data, opts)
|> unwrap!()
end

Expand Down

0 comments on commit e2e531e

Please sign in to comment.