Scroll Infinite in datatable

Hi, I'm doing a search with scroll in java and I add this results, size = 20, in a datatable but I want do that dynamically, that is to say when I do scrolling to datatable add the next 20 results to datatable. How can I do that?

Thanks.

there you go https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/search.html#scrolling :smile:

Scroll uses server side resources so its not safe to expose to the internet. Probably not safe to expose to an intranet for infinite scroll either.

eh? how would you do it then?

From and size with a limit on the depth is the only way to do it where you don't use server side resources between requests. Its not great either because you have to limit from + size because that is the number of results that have to be sorted.

You could also use a filter and a sort - which is the traditional way to do it in relational databases and probably better than from/size now that I think about it.

The big issue with scroll is that it tries to give the user a consistent view of the data. Its super useful for something but its costly.

sounds to me either ways, scroll in distributed cluster is expensive.