I am trying to query a large amount of data from elastic using node js. I have the following query which works perfectly -
client.search({
"index": 'test',
"size": 50,
"type": consts.ReportType.VIOLATION,
"body": searchQuery
}, callback);
My main goal is to fetch data in pieces, each time to get only 50 results as I'll probably have thousands of docs in elastic. I'm displaying the results in pages at client side (let's say like google search results) and wish to get more data from elastic only if needed.
So, is it possible to maintain some index which will tell elastic which is the last response I already got, and to fetch another 50 results from that point?
Thanks