|NO.Z.00026|——————————|BigDataEnd|——|Hadoop&ElasticSearch.V26|——|ELK.v26|集群|QueryDSL|分页|
一、分页
### --- Elasticsearch中实现分页的语法非常简单:
POST /book/_search
{
"query": {
"match_all": {}
},
"sort": [
{"price": {"order": "desc"}}
],
"size": 2,
"from": 0
}

POST /book/_search
{
"query": {
"match_all": {}
},
"sort": [
{"price": {"order": "desc"}}
],
"size": 2,
"from": 2
}
### --- size:每页显示多少条
### --- from:当前页起始索引, int start = (pageNum - 1) * size

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
——W.S.Landor
浙公网安备 33010602011771号