Api clients / Ruby / V1 / Methods

Move Index | Ruby API Client V1 (Deprecated)

Deprecated content
This documentation is for a deprecated version of Ruby API client . Some features and settings may be missing or their usage may have changed. Refer to the documentation for the latest version of Ruby API client for up-to-date information.
Required API Key: any key with the addObject ACL
Method signature
  String indexNameSrc,
  String indexNameDest

About this method

Rename an index. Normally used to reindex your data atomically, without any down time.

The move index method is a safe and atomic way to rename an index.

By using this method, you can keep your existing service running while the data from the old index is being imported into the new index.

This method doesn’t trigger a complete rebuild of the destination index unless it has replicas.

Moving an index overrides the objects and settings of the destination index, with the objects and settings of the source index.

Before performing a move operation, make sure your source index exists. Our API creates a job even when an index doesn’t exist, but because it has no source index, the job won’t be able to end. If you perform a waitTask for this job, the wait will never resolve.

Regarding replicas:

  • Moving to an index having replicas is possible, it will replace the destination index data with the source index data, and the data will be propagated to the replicas
  • Moving an index having replicas is not possible, as it would break the relationship with its replicas

Note this is an expensive operation:

  • when you have more than 100 requests pending, your requests will be throttled.
  • when you have more than 5000 requests pending, further requests will be ignored.
  • if needed, these values can be tuned through configuration.

Moving an index will have no impact on Analytics data because you cannot move an index’s Analytics data.


Move index

// Rename indexNameSrc to indexNameDest (and overwrite it)
$index = $client->moveIndex('indexNameSrc', 'indexNameDest');


type: string

Index name of the index to move.

type: string

Index name of the destination index.

type: object

Source index object.

type: object

Destination index object.


In this section we document the JSON response returned by the API. Each language will encapsulate this response inside objects specific to the language and/or the implementation. So the actual type in your language might differ from what is documented.

JSON format

  "updatedAt": "2017-12-18T21:22:40.761Z",
  "taskID": 19541511530

Date at which the job to copy the index has been created.


This is the taskID which is used with the waitTask method.

Note You can use either the source or destination index to wait on the resulting taskID. In either case, the wait will include the full copy process.

Did you find this page helpful?