src/ElasticSearch/Transport/Memcached.php
public function index($document, $id=false, array $options = array()) {
        if ($id === false)
            throw new \ElasticSearch\Exception("Memcached transport requires id when indexing");

        $document = json_encode($document);
        $url = $this->buildUrl(array($this->type, $id));
        $response = $this->conn->set($url, $document);
        return array(
            'ok' => $response
        );
    }
public function index($document, $id=false, array $options = array()) {
        if ($id === false)
            throw new \ElasticSearch\Exception("Memcached transport requires id when indexing");

        $document = json_encode($document);
        $url = $this->buildUrl(array($this->type, $id));
        $response = $this->conn->set($url, $document);
        return array(
            'ok' => $response
        );
    }
public function index ( $ document , $ id = false , array $ options = array ( ) ) { if ( $ id === false ) throw new \ ElasticSearch \ Exception ( "Memcached transport requires id when indexing" ) ; $ document = json_encode ( $ document ) ; $ url = $ this -> buildUrl ( array ( $ this -> type , $ id ) ) ; $ response = $ this -> conn -> set ( $ url , $ document ) ; return array ( 'ok' => $ response ) ; }
Index a new document or update it if existing

@return array
@param array $document
@param mixed $id Optional
@param array $options
@throws \ElasticSearch\Exception
Index a new document or update it if existing