-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix copy index command #83
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, in Connection.php line 209
, that variable is no longer being used.
if ($limit > $numResults) { | ||
foreach ($this->scroll($scrollId, $scrollTimeout, $limit - $numResults) as $result) { | ||
if (! $limit || $limit > $numResults) { | ||
$limit = $limit ? $limit - $numResults : $limit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm being an idiot, but I'm not sure I understand this line, I mean I get that you're setting the limit, but I can figure out what $limit - $numResults
is doing. So I have a limit of, say, 100
, and the number of results is 25
, set the limit to 75
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry yeah, it's confusing. The default limit will be zero so all results will be returned, but if you want a scroll cursor with 1000 results and the first query (on line 205) returns 100 results, then you want to scroll through 900 additional results, so 900 gets passed to scroll()
and at line 255 it will break out of the scroll once that's been hit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohhh I see, ok I'm with you!
Good one on line 209, thanks - I'll remove. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The cursor method was defaulting to 100,000 records and failing to allow it to be set to zero, so copying the index was stopping after hitting that limit.