查詢所有
命令:
GET fcy_trace_log/_search
{
"query": {
"match_all": {
}
}
}
結果
{
"took": 5, 查詢事件
"timed_out": false, 是否超時
"_shards": {
"total": 2, 分片
"successful": 2,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 16, 查詢結果總數(shù)
"max_score": 1,
"hits": [
{
"_index": "fcy_trace_log",
"_type": "fcy_trace_type",
"_id": "9UTIF3IBIDm_yOFoO5VC",
"_score": 1,
"_source": {
"operPath": "客戶管理/新增頁面/新增按1鈕",
"realName": "xxx",
"system": "xxdkd",
"tarceTime": "2020-05-15T18:01:36.865+08:00",
"operation": "0",
"userId": "10"
}
},
帶參數(shù)查詢:
GET fcy_trace_log/_search
{
"query": {
"match": {
"realName": "xxx" 如果該字段支持全文檢索則這樣可以做到模糊查詢效果,不然就是精確查詢
}
}
}
分頁查詢:
GET fcy_trace_log/_search
{
"query": {
"match_all": {
}
},
"from": 1, 第一頁
"size": 2 每頁2條
}