Skip to content

Instantly share code, notes, and snippets.

@dimitardanailov
Created February 17, 2022 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimitardanailov/f7bd51f3a834e5dbcf9f4f9723e7b4b8 to your computer and use it in GitHub Desktop.
Save dimitardanailov/f7bd51f3a834e5dbcf9f4f9723e7b4b8 to your computer and use it in GitHub Desktop.
ElasticSearch: Delete an index
'use strict'
const {Client} = require('@elastic/elasticsearch')
const client = new Client({node: 'http://localhost:9200'})
client.indices
.delete({
index: 'audit-*',
})
.then(
function (resp) {
console.log('Successful query!')
console.log(JSON.stringify(resp, null, 4))
},
function (err) {
console.trace(err.message)
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment