// remove all the content in an index clearIndex(index) { return this.client.deleteByQuery({ index, body: { query: { match_all: {}, }, }, }) }
client.deleteByQuery({ index: 'world', body: { query: { match_all: {} } }, timeout: "5m" }, function(err, resp, status) { console.log(resp); });
return deleteByScroll(); } else { return client.deleteByQuery({ index: index, type: type,
async clearOpfiles(siteId) { return await this.client.deleteByQuery({ index: "op_file", type: "_doc", body: { "query": { "constant_score": { "filter": { "term": { siteId } } } } } }) }
async clearFeeds(siteId) { return await this.client.deleteByQuery({ index: "feed", type: "_doc", body: { "query": { "constant_score": { "filter": { "term": { siteId } } } } } }) }