Is there a limit to scrolling or have i misunderstood size?

HI All,

I've written some code in Classic asp that uses scrolling. On a particular search I know that I should be obtaining 1033 records. When I set my page size to 40 and perform my initial search then loop calling the scroll function it consistently only iterates enough to return 230 records. If I change my page size to be 1500 I have returned the full expected 1033 records.

I take 1033/40 which gives me 25.825. I there for set a loop to run 26 times because I round up. Additionally if I just multiply this by 2 just because ; so that my loop runs 52 times I still only receive 230 records back????

Have I misunderstood the Size parameter?

Hi bilpor,

In the scroll documentation it says:

The size parameter allows you to configure the maximum number of hits to be returned with each batch of results. Each call to the scroll API returns the next batch of results until there are no more results left to return, ie the hits array is empty.

So when scrolling you don't need to calculate the number of pages, just choose a size value (for example, 100) and keep calling the scroll API until your list of hits is empty (meaning that you have already scrolled all documents).

Can you check if this algorithm works for you?

Cheers,
LG

It does work, but I do have to calculate the amount of pages I have. Using rest to based call from classic asp to obtain the records doesn't allow me to test for empty. I cannot test for the literal word empty, I cannot test for an empty object and I cant test for nothing, So I really do need to keep a count of records. If I had the ability to use the .NET library then I could probably handle and test for it in an efficient way, but for now I'm integrating this into outdated technology.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.