$elasticaIndex = $this->getBackend()->getIndex(); //returns a \Elastica\Index object$type = $elasticaIndex->getType( 'office' );$docs = [];foreach( $documentConfigs as $dc ) {
$docs[] = new \Elastica\Document( $dc['id'], $dc ); //$dc contains a field 'data' with the base64 encoded file}$result = $type->addDocuments( $docs );$elasticaIndex->refresh();