public function updateOrIndex($indexName, $type, $id, array $data)
	{
		if ($this->exists($indexName, $type, $id)) {
			return $this->update($indexName, $type, $id, $data);
		} else {
			return $this->index($indexName, $type, $data);
		}
	}
public function updateOrIndex($indexName, $type, $id, array $data)
	{
		if ($this->exists($indexName, $type, $id)) {
			return $this->update($indexName, $type, $id, $data);
		} else {
			return $this->index($indexName, $type, $data);
		}
	}
public function updateOrIndex ( $ indexName , $ type , $ id , array $ data ) { if ( $ this -> exists ( $ indexName , $ type , $ id ) ) { return $ this -> update ( $ indexName , $ type , $ id , $ data ) ; } else { return $ this -> index ( $ indexName , $ type , $ data ) ; } }
Update a document. Create it if it doesn't exist.

@return array

@param string $indexName
@param string $type
@param string $id
@param array $data
Update a document . Create it if it doesn t exist .