This page documents an earlier version of the API client. For the latest version, see Copy or move an index.
addObject
You can copy the entire index (records, settings, synonyms, and rules) or one or more of the following scopes:
- Settings
- Synonyms
- Rules
enableReRanking
and mode
settings.
Rate limiting
Copying an index is rate-limited:- If you have more than 100 pending requests, your requests are throttled.
- If you have more than 5,000 pending requests, further requests are ignored.
Source indices
Copying a source index that doesn’t exist creates a new index with 0 records. If the source index has replicas, the replicas won’t be copied.Destination indices
When copying indices within the same Algolia application, the destination index is replaced if it exists. You can’t copy an index between two Algolia applications, if the destination index exists. Everything apart from the analytics data is replaced. You can’t copy to a destination index that already has replicas.Analytics
Copying an index has no impact on Analytics. You can’t copy an index’s analytics data.Scopes
To copy parts of your source index, use thescope
parameter.
If you omit the scope
parameter, everything is copied.
For example, to copy an index’s settings and synonyms, but not records and rules,
set the scope
parameter to: ["settings", "synonyms"]
.
-
The scope is replaced completely.
Different items belonging to the same scope are not merged.
For example, with
scope: "settings"
, all settings of the destination index are replaced with the settings of the source index. - Items in different scopes are preserved.
-
If you set the
scope
parameter, records aren’t copied.
Examples
Copy an index
Copy parts of an index with scopes
Copy index between apps
Parameters
Destination index object.
Name of the destination index.
Name of the source index to copy.
Source index object.
An array containing any combination of the following strings:
settings
synonyms
rules
Response
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.Date at which the job to copy the index has been created.
Response as JSON
This section shows the JSON response returned by the API. Each API client wraps this response in language-specific objects, so the structure may vary. To view the response, use thegetLogs
method.
Don’t rely on the order of properties—JSON objects don’t preserve key order.
JSON