Skip to content

Commit

Permalink
change endpoint for delete_by_query for ES8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
wkdewey committed Jan 26, 2023
1 parent 7b90a09 commit f982173
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/datura/elasticsearch/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def self.clear_all(options)
puts "Type: 'Yes I'm sure'"
confirm = STDIN.gets.chomp
if confirm == "Yes I'm sure"
url = File.join(options["es_path"], options["es_index"], "_doc", "_delete_by_query?pretty=true")
url = File.join(options["es_path"], options["es_index"], "_delete_by_query?pretty=true")
auth_header = Datura::Helpers.construct_auth_header(options)
json = { "query" => { "match_all" => {} } }
RestClient.post(url, json.to_json, auth_header.merge({ content_type: :json })) { |res, req, result|
Expand All @@ -226,7 +226,7 @@ def self.clear_all(options)
end

def self.clear_index(options)
url = File.join(options["es_path"], options["es_index"], "_doc", "_delete_by_query?pretty=true")
url = File.join(options["es_path"], options["es_index"], "_delete_by_query?pretty=true")
confirmation = self.confirm_clear(options, url)

if confirmation
Expand Down

0 comments on commit f982173

Please sign in to comment.