es常用查询

GET /

GET /_cat/indices?v

GET /ads_iot_electricity_index/_doc/_mapping

GET /wfs_order_track_index/_doc/_mapping

GET /tms_order_index/_doc/_mapping

GET /_cat/count

#指定index的数据量
GET /_cat/count/wfs_order_list_index

# type 是 _doc,查询type的全部数据
GET /iot_history_data_electricity_index/_doc/_search

GET /ads_iot_electricity_index/_doc/_search

DELETE /ads_iot_electricity_index




GET /tms_order_index/_doc/_search

GET /wfs_order_track_index/_doc/_search

# 查询指定id的document
GET /wfs_order_list_index/_doc/463054288245899264

#日期精确查询
GET /wfs_order_list_index/_doc/_search
{
  "query": {
    "term": {
      "disposeTime": "2020-05-25 15:31:49"
    }
  }
}

#日期范围查询
GET /wfs_order_list_index/_doc/_search
{
  "query": {
    "bool": {
      "should": {
        "range": {
          "orderCreateTime": {
            "gte": "2020-01-01 00:00:00",
            "lte": "2020-01-01 23:59:59"
          }
        }
      }
    }
  }
}

GET /wfs_order_list_index/_doc/_search
{
  "query": {
    "bool": {
      "should": {
        "range": {
          "orderUpdateTime": {
            "gte": "2020-06-16 00:00:00",
            "lte": "2020-06-16 23:59:59"
          }
        }
      }
    }
  }
}


#日期范围查询
GET /wfs_order_list_index/_doc/_search
{
  "query": 
  {
    "bool": 
    {
      "should": 
      [
        {
        "range": {
          "orderCreateTime": 
          {
            "gte": "2020-06-16 00:00:00",
            "lte": "2020-06-16 23:59:59"
          }
        }
      },
      {
        "range": {
          "orderUpdateTime": 
          {
            "gte": "2020-06-16 00:00:00",
            "lte": "2020-06-16 23:59:59"
          }
        }
      }
    ]
    }
  }
}



GET /wfs_order_list_index/_doc/_search
{
  "query": { "match_all": {} }
}



GET /wfs_order_track_index/_doc/_search
{
  "query": { "match_all": {} }
}

GET /wfs_order_track_index/_doc/_search
{
  "query": {
    "bool": {
      "filter": {
        "range": {
          "createTime": {
            "gte": "2020-06-18 00:00:00",
            "lte": "2020-06-18 23:59:59"
          }
        }
      }
    }
  }
}


GET /wfs_order_list_index/_doc/_search
{
  "query": {
    "bool": {
      "should": {
        "range": {
          "orderUpdateTime": {
            "gte": "2020-06-16 00:00:00",
            "lte": "2020-06-16 23:59:59"
          }
        }
      }
    }
  }
}


#运送order日期范围查询
GET /tms_order_index/_doc/_search
{
  "query": 
  {
    "bool": 
    {
      "should": 
      [
        {
        "range": {
          "createTime": 
          {
            "gte": "2020-06-20 00:00:00",
            "lte": "2020-06-20 23:59:59"
          }
        }
      },
      {
        "range": {
          "updateTime": 
          {
            "gte": "2020-06-20 00:00:00",
            "lte": "2020-06-20 23:59:59"
          }
        }
      }
    ]
    }
  }
}

过滤,聚合查询
{
    "aggs": {
        "data": {
            "stats": {
                "field": "addValue"
            }
        }
    },
    "query": {
        "bool": {
            "must": [
                {
                    "range": {
                        "acquisitionTime": {
                            "gt": "2020-08-28 00:00:00",
                            "lt": "2020-08-28 23:59:59"
                        }
                    }
                },
                {
                    "term": {
                        "projectId": "120100LAE"
                    }
                },
                {
                    "term": {
                        "type": 4
                    }
                }
            ],
            "must_not": [],
            "should": []
        }
    },
    "size": 0,
    "sort": []
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值