AlgoliaSearch\Client::moveIndex PHP Method

moveIndex() public method

Move an existing index.
public moveIndex ( string $srcIndexName, string $dstIndexName ) : mixed
$srcIndexName string the name of index to copy.
$dstIndexName string the new index name that will contains a copy of srcIndexName (destination will be overwritten if it already exist).
return mixed
    public function moveIndex($srcIndexName, $dstIndexName)
    {
        $request = array('operation' => 'move', 'destination' => $dstIndexName);
        return $this->request($this->context, 'POST', '/1/indexes/' . urlencode($srcIndexName) . '/operation', array(), $request, $this->context->writeHostsArray, $this->context->connectTimeout, $this->context->readTimeout);
    }

Usage Example

示例#1
0
 /**
  * Index all of the available documentation.
  *
  * @return void
  */
 public function indexAllDocuments()
 {
     foreach (Documentation::getDocVersions() as $key => $title) {
         $this->indexAllDocumentsForVersion($key);
     }
     $this->setSettings();
     $this->client->moveIndex($this->index->indexName, static::$index_name);
 }
All Usage Examples Of AlgoliaSearch\Client::moveIndex