Skip to navigation

Copy Index

Create a new index with this index’s fields, settings, synonyms and rules, and its records unless records is false. Takes a write key for every index.

Authentication

AuthorizationBearer

A write key, issued by Captain. Server side only. Sent as Authorization: Bearer <key>.

Path parameters

indexstringRequiredformat: "^[a-z0-9][a-z0-9_-]{0,47}$"
index name

Headers

Idempotency-KeystringOptional<=255 characters

Replays within 24 hours return the stored response (header Idempotent-Replayed: true). The same key on a different request answers 422. A concurrent duplicate answers 409. Failed requests do not keep the key.

Request

This endpoint expects an object.
tostringRequired
recordsbooleanOptionalDefaults to true

Response headers

X-Captain-Applied-Seqinteger

the last update seq search had applied when this request started; the answer reflects at least that much (GET …/updates applied_seq). Not on 401 or 403, nor for an index this server does not have

X-Captain-Index-IncarnationstringOptional

the index’s incarnation, an opaque string: it changes only when the index is deleted and created again (whose seqs start again at 1), or restored from a backup (whose seqs continue from the backup’s). Sent with X-Captain-Applied-Seq

Response

copied, no records
namestringOptional
the index name
id_fieldstringOptional

Create Index only: the field that holds each record’s id

statusenumOptional

empty: no records yet. pending: changes were accepted and are being applied. building: Captain is refreshing suggestions and spelling in the background, and search serves as usual. ready: every change is applied.

Allowed values:
record_countintegerOptional
Records the index holds, built or not.
staged_recordsintegerOptional

the same value as record_count, under its older name

staged_documentsintegerOptional

the same value as record_count, under its older name

pending_changesbooleanOptional
True while accepted changes are still being applied.
staged_changes_since_buildbooleanOptional

the same value as pending_changes, under its older name

build_idstring or nullOptional

the build search serves; null before the first one

last_jobstring or nullOptional
the id of the index's latest job, for Get Job
last_build_atinteger or nullOptional

unix seconds the serving build finished; null when nothing is served, or for a build whose finish time was not recorded

created_atintegerOptional
unix seconds
servingobject or nullOptional
The build search is serving, and how many records it holds.