注:delete by query只適用於低於elasticsearch2.0的版本(不包含2.0)。有兩種形式:
1.無請求體
curl -XDELETE 'localhost:9200/twitter/tweet/_query?q=user:kimchy'
2.有請求體
使用請求體的時候,請求體中只能使用query查詢,不能使用filter
curl -XDELETE 'localhost:9200/twitter/tweet/_query' -d '{
"query":{
"term":{"user":"kimchy"}
}
}'
刪除全部:
"query":{
"match_all":{}
}
}