{
"from": 3,
"size": 4,
"query": {
"match_all": {}
}
}The 'from' parameter skips the first 3 documents (1, 2, 3). Then 'size' 4 returns the next 4 documents: 4, 5, 6, 7.
{
"from": 0,
"size": 0,
"query": {
"match_all": {}
}
}Setting 'size' to 0 returns no hits but still returns metadata such as total hits count.
{
"from": -5,
"size": 10,
"query": {
"match_all": {}
}
}The 'from' parameter must be zero or positive. Negative values cause a validation error.
Using large 'from' values makes Elasticsearch skip many documents internally, which slows down queries.
{
"from": 1,
"size": 2,
"sort": [{"age": "asc"}],
"query": {
"match_all": {}
}
}Sorted ascending by age: [10, 20, 30, 40, 50]. 'from':1 skips 10, next two are 20 and 30.
