less than 1 minute read

常用 ES 操作汇总

查询 ES 数据

URL:http://IP:PORT/person_dynamic/_search

{
  "query": {
    "bool": {
      "must": [
        {
          "range": {
            "captureTime": {
              "gt": "2023-08-16 13:00:00",
              "lt": "2023-08-16 13:10:00"
            }
          }
        }
      ]
    }
  }
}

删除 ES 数据

URL:http://IP:PORT/person_dynamic/_delete_by_query

{
  "query": {
    "bool": {
      "must": [
        {
          "range": {
            "captureTime": {
              "gt": "2023-08-16 13:00:00",
              "lt": "2023-08-16 13:10:00"
            }
          }
        }
      ]
    }
  }
}

查询索引结构

curl --location 'http://IP:PORT/test04/_mapping'

查询所有索引库

curl --location 'http://IP:PORT/_cat/indices'

Updated:

Leave a comment