Elasticsearch對type的刪除操作,版本不同,對應的操作有所不同,今天給大家科普一下5.X版本對type的刪除操作:
# hot_rank是index / sina_hot_search_rank是type curl -XPOST 'localhost:9200/hot_rank/sina_hot_search_rank/_delete_by_query?conflicts=proceed&pretty' -H 'Content-Type: application/json' -d' { "query": { "match_all": {} } } '
這樣,整個type中的數據將被全部清空,所以要慎重~