-
Notifications
You must be signed in to change notification settings - Fork 395
Description
Commented here:
#148 (comment)
The last commit which merged PR #148 broke bulk indexing completely.
I'm pretty sure this is broken. You're calling
chunkon a Collection, which does not take a callback argument. Onlychunkon Query Builders takes a callback.Collection method -> only argument is
$size
Query Builder method -> takes both$sizeand$callbackWas this tested? The callback never gets entered, because it doesn't accept a callback as a parameter. At least when I've tried
Model::addAllToIndex()I also strongly disagree with implementing this in this way. If somebody wants to index all in one go, they should be able to, and damn the (lack of memory) consequences. If they want to chunk it, they can do that on their own. There's no need to chunk for them
Model::chunk(500, function (ElasticquentCollection $chunk) { $chunk->addToIndex(); });^ that is what I was doing before, which this PR broke