POST movies/_search
{
"from":0,
"size": 100,
"query": {
"match_all": {}
}
}
//Search After
DELETE users
POST users/_doc
{ "name":"user1","age":10}
POST users/_doc
{ "name":"user2","age":11}
POST users/_doc
{ "name":"user3","age":12}
POST users/_doc
{ "name":"user4","age":13}
POST users/_count
POST users/_search
{
"size": 1,
"query": {
"match_all": {}
},
"sort": [
{"age":"desc"},
{"_id":"asc"}
]
}
POST users/_search
{
"size": 1,
"query": {
"match_all": {}
},
"search_after":[
13,
"JEOYUn0BQpSWQp29DG_V"
],
"sort": [
{"age":"desc"},
{"_id":"asc"}
]
}
POST users/_search
{
"size": 1,
"query": {
"match_all": {}
},
"search_after":[
12,
"I0OYUn0BQpSWQp29BW-o"
],
"sort": [
{"age":"desc"},
{"_id":"asc"}
]
}
//Scroll API
DELETE users
POST users/_doc
{"name":"user1","age":10}
POST users/_doc
{"name":"user2","age":20}
POST users/_doc
{"name":"user3","age":30}
GET /users/_count
POST /users/_search?scroll=5m
{
"size": 1,
"query": {
"match_all": {}
}
}
"FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFnBJSElzcTlVU1BxM2xyODZJckxrN1EAAAAAAAD__BZSaWJaUUpENVNzV2RmbUpMeHcyNzBR",
POST users/_doc
{"name":"user4","age":40}
POST /_search/scroll
{
"scroll":"1m",
"scroll_id":"FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFnBJSElzcTlVU1BxM2xyODZJckxrN1EAAAAAAAD__BZSaWJaUUpENVNzV2RmbUpMeHcyNzBR"
}
"FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFnBJSElzcTlVU1BxM2xyODZJckxrN1EAAAAAAAD__BZSaWJaUUpENVNzV2RmbUpMeHcyNzBR"
POST /_search/scroll
{
"scroll":"1m",
"scroll_id":"FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFnBJSElzcTlVU1BxM2xyODZJckxrN1EAAAAAAAD__BZSaWJaUUpENVNzV2RmbUpMeHcyNzBR"
}
"FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFnBJSElzcTlVU1BxM2xyODZJckxrN1EAAAAAAAD__BZSaWJaUUpENVNzV2RmbUpMeHcyNzBR"
POST /_search/scroll
{
"scroll":"1m",
"scroll_id":"FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFnBJSElzcTlVU1BxM2xyODZJckxrN1EAAAAAAAD__BZSaWJaUUpENVNzV2RmbUpMeHcyNzBR"
}
"FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFnBJSElzcTlVU1BxM2xyODZJckxrN1EAAAAAAAD__BZSaWJaUUpENVNzV2RmbUpMeHcyNzBR"
POST /_search/scroll
{
"scroll":"1m",
"scroll_id":"FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFnBJSElzcTlVU1BxM2xyODZJckxrN1EAAAAAAAD__BZSaWJaUUpENVNzV2RmbUpMeHcyNzBR"
}