original_string: public function index()
      {
          if ($this->isEmpty()) {
              return false;
          }
  
          $params = array();
  
          foreach ($this->all() as $item) {
              $params['body'][] = array(
                  'index' => array(
                      '_index' => $item->getIndex(),
                      '_type' => $item->getTypeName(),
                      '_id' => $item->getKey()
                  )
              );
  
              $params['body'][] = $item->documentFields();
          }
  
          return $this->getElasticClient()->bulk($params);
      }
code: public function index()
      {
          if ($this->isEmpty()) {
              return false;
          }
  
          $params = array();
  
          foreach ($this->all() as $item) {
              $params['body'][] = array(
                  'index' => array(
                      '_index' => $item->getIndex(),
                      '_type' => $item->getTypeName(),
                      '_id' => $item->getKey()
                  )
              );
  
              $params['body'][] = $item->documentFields();
          }
  
          return $this->getElasticClient()->bulk($params);
      }
code_tokens: public function index ( ) { if ( $ this -> isEmpty ( ) ) { return false ; } $ params = array ( ) ; foreach ( $ this -> all ( ) as $ item ) { $ params [ 'body' ] [ ] = array ( 'index' => array ( '_index' => $ item -> getIndex ( ) , '_type' => $ item -> getTypeName ( ) , '_id' => $ item -> getKey ( ) ) ) ; $ params [ 'body' ] [ ] = $ item -> documentFields ( ) ; } return $ this -> getElasticClient ( ) -> bulk ( $ params ) ; }
docstring: Indexes all the results from the
  collection.
  
  @return array
docstring_tokens: Indexes all the results from the collection .