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);
    }
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);
    }
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 ) ; }
Indexes all the results from the
collection.

@return array
Indexes all the results from the collection .