Skip to content

Instantly share code, notes, and snippets.

@firecentaur
Created May 28, 2020 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save firecentaur/0b4b222a9f854ae42b65cabff4b56015 to your computer and use it in GitHub Desktop.
Save firecentaur/0b4b222a9f854ae42b65cabff4b56015 to your computer and use it in GitHub Desktop.
public function indexVideosBulk($videos)
{
$videosIndex = Yii::app()->params['videosIndex'];
/**
* @var $video Video
* var/class
*/
if (!$this->elasticConfigured) {
return false;
}
$params = [
'index' => $videosIndex,
'type' => 'video',
'id' => intval($video->id),
'body' => $videos
];
$this->getElasticClient()->bulk($params);
unset($params);
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment