-
-
Notifications
You must be signed in to change notification settings - Fork 251
Open
Labels
type:enhancementEnhancementEnhancement
Description
Just look at this code:
$models = EsPost::find()->andWhere(['author' => $id])->all();
foreach($models as $model) {
$model->doSomething();
$model->save();
}This produces multiple ES requests, but it is really possible to make a bulk of them:
$models = EsPost::find()->andWhere(['author' => $id])->all();
EsPost::getDb()->beginBulk();
foreach($models as $model) {
$model->doSomething();
$model->save();
}
EsPost::getDb()->executeBulk();What do you think?
I already implemented this feature and can make a PR if you are interested
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type:enhancementEnhancementEnhancement