[英]elasticsearch how to get previous data using scroll
I used this sample for making a pagination function 我使用此样本进行分页功能
POST /twitter/_search?scroll=1m
{
"size": 100,
"query": {
"match" : {
"title" : "elasticsearch"
}
}
}
POST /_search/scroll
{
"scroll" : "1m",
"scroll_id" : "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ=="
}
But there is one problem This code can get next data but not previous data how should I solve this problem?? 但是有一个问题,这段代码可以获取下一个数据,而不能获取先前的数据,我该如何解决这个问题?
If you want to use pagination you should rather use From / Size than scroll. 如果要使用分页,则应使用“ 自/大小”而不是滚动。
You can refer also to this answer : Elasticsearch Scroll it explain the difference with scan and scroll 您也可以参考以下答案: Elasticsearch Scroll解释与scan和scroll的区别
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.