question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scan & Scroll w/o Skipping the First Lines?

See original GitHub issue

Hopefully this is an easy one.

I’m scanning & scrolling as such:

  var scanResults = esClient.Search<DeliveryEvent>(s => s
                .From(0)
                .Size(10)
                .MatchAll()
                .Query(q => q.Term(f => f.UserID, user)
                    && q.Range(r => r.OnField(f => f.ReceivedAt).From("2013-03-06T00:00:00.000-05:00").To("2013-03-25T00:00:00.000-05:00")))
                .SearchType(Nest.SearchType.Scan)
                .Scroll("60m")
            );

            var results = esClient.Scroll<DeliveryEvent>("1m", scanResults.ScrollId);
            while (results.Documents.Any())
            {
                results = esClient.Scroll<DeliveryEvent>("1m", results.ScrollId);

                do some more stuff 
                }
            }

I’d like to scroll by a larger number than 10 but if I set the number high, the first scroll ( var results = esClient.Scroll<DeliveryEvent>(“1m”, scanResults.ScrollId)😉 sets it ahead too far and I miss documents. Is there a way to structure this so that the first scroll I’m doing work on is at the beginning? I borrowed this structure from the NEST tests so hopefully I’m setting it up right.

Thx!

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jptotocommented, Jun 14, 2016

I haven’t used the clear scroll API before. As long as the file descriptors are set high on your ES servers, and they should be, It shouldn’t be a problem. You can also set the scrolls to expire sooner. In the example I gave it’s set to 20 minutes.

1reaction
jptotocommented, Jun 14, 2016

@nasreekar Glad it’s working! That cold was a bit old so perhaps the namespaces are a bit different now. Glad I could help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Scanner skipping rows occasionally · Issue #321
It looks like the first row being skipped is always row number 56. After scrolling to the page beginning in row 56, the...
Read more >
file io - Java - Scanner Class - Skipping over the first line ...
When using a Scanner object to read from a textfile, I want it to skip over the very first line in the file....
Read more >
Scanner skipping first line : r/javahelp
Basically, I am trying to sum up the third column, however, it is skipping over the first line. Does anyone know how to...
Read more >
How to Fix Mouse Scroll Wheel Jumping in Windows 10 ...
Go to the Wheel tab. Under Vertical Scrolling, lower the number of lines that the mouse wheel can scroll. Now, move to the...
Read more >
Smooth scrolling through pages
Solved: Hello, I am using Acrobat X. I have noticed that with some PDF documents I can smoothly scroll from one page to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found