I have an elastic search index with about 2 million records which I would like to view in a HTML table. The issue i`m facing is that I don't want to pollute the browser's memory with all that data, instead I would like to do the following:
- Once the table is loaded, make a query to elastic search to find out how many records are in total (this number will be used to approximate the size of the scrollbar)
- Make another query to obtain the first 1000 records and display them in the table.
- Modify the table's scrollbar to give the impression to the user that all the records are loaded
- Once the user starts scrolling down, add more records to the table and remove old records (to save memory)
I need advice regarding how to design this system and possible implementation solutions.
Thank you