Is it possible to get the nested sub elements in a document in a paginated fashion. Example we have a document as below and we would know the document id
{
"_index": "index1",
"_type": "type1",
"_id": "81cabf3c-51f5-442a-b78d-4324c4344f51",
"_version": 1,
"found": true,
"_source": {
"chiild1" : "child1 value"
"names": [
{
"name": "John"
},
{
"name": "Walter"
},
{
"name": "Justin"
},
{
"name": "Cramer"
}
]
}
}
Can we run a query like below (It does not work but are there other options ?)
GET index1/type1/81cabf3c-51f5-442a-b78d-4324c4344f51?_source_include=names.name&start=0&size=2
{
"_index": "index1",
"_type": "type1",
"_id": "81cabf3c-51f5-442a-b78d-4324c4344f51",
"_version": 1,
"found": true,
"_source": {
"names": [
{
"name": "John"
},
{
"name": "Walter"
}
]
}
}
GET index1/type1/81cabf3c-51f5-442a-b78d-4324c4344f51?_source_include=names.name&start=2&size=2
{
"_index": "index1",
"_type": "type1",
"_id": "81cabf3c-51f5-442a-b78d-4324c4344f51",
"_version": 1,
"found": true,
"_source": {
"names": [
{
"name": "Justin"
},
{
"name": "Cramer"
}
]
}
}