ES常见的语句

全覆盖修改

  • url: http://url:port/index/type/id

  • method:PUT

  • body

{
  
    "id": "46",
    "fileId": "ad6643000e0d6f0801f9af65413ce093",
    "type": "TRAN_SESD",
    "status": "DOING",
    "createdTime": 1565318242000,
    "updatedTime": 1565323396000

}

部分字段修改

  • url: http://url:port/index/type/id/_update

  • method:POST

  • body

{
  "doc": {
    "status": "DOING"
  }
}

根据条件删除

  • url: http://url:port/index/type/_delete_by_query
  • method: POST
  • body
{
  "query": {
    "match": {
      "fileId": "ad6643000e0d6f0801f9af65413ce093"
    }
  }
}

根据id 删除

  • url: http://url:port/index/type/id
  • method: DELETE
  • body

查看文档

  • url: http://url:port/index/type/id
  • method: GET
  • body

自定义id新增文档

  • url: http://url:port/index/type/id
  • method:PUT
  • body
{
  
    "id": "46",
    "fileId": "ad6643000e0d6f0801f9af65413ce093",
    "type": "TRAN_SESD",
    "status": "DOING",
    "createdTime": 1565318242000,
    "updatedTime": 1565323396000

}

非自定义id新增文档

  • url: http://url:port/index/type
  • method:POST
  • body
{
  
    "id": "46",
    "fileId": "ad6643000e0d6f0801f9af65413ce093",
    "type": "TRAN_SESD",
    "status": "DOING",
    "createdTime": 1565318242000,
    "updatedTime": 1565323396000

}
posted @ 2019-08-12 17:41  晚安,Jake  阅读(1722)  评论(0编辑  收藏  举报