Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Elasticsearch deletes index command according to condition

Shulou Source: shulou.com Published: 2022-06-03 07:18:22 09月23日 Update

In the past, it was deleted according to the id of the document in the index. In fact, Elasticsearch supports deletion based on conditions:

Delete the eligible record of a type in the index:

Curl-XDELETE http://localhost:9200/indexname/typename/_query?pretty-d'{"query": {"filtered": {"filter": {"bool": {"must": {"range": {"logtime": {"gt": "20171214235459" "lt": "20171215235959"}

Delete all eligible records in the index:

Curl-XDELETE http://localhost:9200/indexname/_query?pretty-d'{"query": {"filtered": {"filter": {"bool": {"must": {"range": {"logtime": {"gt": "20171214235459" "lt": "20171215235959"}

Tags: Conditions indexes documents support commands Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB MySQL Huawei Microsoft macOS