在ElasticSearch2.0之后的版本中沒有默認的delete-by-query,想使用此命令需要安裝這個插件经磅。
首先需要進入ES的目錄
[root@node122 elasticsearch]# pwd
/usr/share/elasticsearch
# bin/plugin install delete-by-query
-> Installing delete-by-query...
Trying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/delete-by-query/2.4.1/delete-by-query-2.4.1.zip ...
Downloading ...........DONE
Verifying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/delete-by-query/2.4.1/delete-by-query-2.4.1.zip checksums if available ...
Downloading .DONE
Installed delete-by-query into /usr/share/elasticsearch/plugins/delete-by-query