1. Request Body Search
将查询语句通过HTTP Request Body 发送给Elasticsearch
1.1 404_idx
//ignore_unavailable=true,可以忽略尝试访问不存在的索引“404_idx”导致的报错
POST /test,404_idx/_search?ignore_unavailable=true
{
"profile": true,
"query": {
"match_all": {}
}
}
// 没有test 这个索引 但是并不会报错 而是返回hit number 为0
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 0,
"successful" : 0,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : 0.0,
"hits" : [ ]
}
}
1.2 分页
from
表示从第10个开始显示
size
表示一页显示20个
获取靠后的翻页成本较高