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
Alternative scoll/scan implementation #51
Conversation
This looks awesome, thanks! Will make sure this goes into the next release. |
Should I fix |
not sure how this is related? you mean to use the scroll api to iterate over the models to update/delete? |
Exactly! The problem with updateAll/deleteAll is that it first needs to get all document ids, then perform the action. As far as I know, search API doesn't even let you get all results (you can set |
Good idea, afair, setting size to max_int will result in ES to allocate that amount of memory regardsless of the number of results or so. May not be the case anymore but using scroll api sounds like a good idea. |
/** | ||
* @var string|integer the key for the current iteration | ||
*/ | ||
private $_key = null; |
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.
parent method key() and current() will not access the private members in this class but the ones of the parent class.
I'd prefer to duplicate the BatchQueryResult from framework here, we may later extract a proper base class from these if it makes sense.
looks good so far except for the comments added. Also needs a CHANGELOG entry and |
👍 |
Hi!
I've implemented my own version of batch query for elasticsearch. It is consistent with other db classes. In other words, batch query processing is done with
batch()
andeach()
functions. Also, I've written some tests for this functionality.I would love to see this commit merged into trunk, because then I shall be able to fix issues #48 and #19.