younifyd
Menu

Convert an index into a document index

Convert an index into a document index

POST/indexes/{index_name}/convert

Use it in a workflow

  1. Add a step and choose the Pinecone connector.
  2. Pick the Convert an index into a document index action (under Indexes).
  3. Fill in the fields below, then reference the result from later steps as {{convertAnIndexIntoADocumentIndex.response.data}}.

Request

Path parameters

index_namestringrequired

The name of the vector index to convert.

Request body

Enter the body as JSON in the step's Body field.

namestringrequired

The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'.

schemaobjectrequired

The fields the index searches over: dense vectors, sparse vectors, and string fields searched by full-text search or by embeddings Pinecone derives from their text. An index has one dense vector slot and one sparse vector slot: at most one field can be a `dense_vector` field or declare `embed`, and at most one can be a `sparse_vector` field or declare `sparse_embed`. Metadata isn't declared in the schema; it's indexed automatically from the documents you upsert.

fieldsobjectrequired

A map of field names to field configurations. Names are at most 64 bytes and can't start with `$`. Names starting with `_` are reserved; to create a vector index with the reserved `_values` and `_sparse_values` fields, see [Adopt the Documents API](https://docs.pinecone.io/guides/index-data/adopt-the-documents-api#what-this-means-for-your-existing-code).

error_modeobject

How a conversion handles a source record the new index cannot take, such as a record whose metadata value for a `full_text_search` field is not a string. Records the schema can hold are never affected. If omitted, `on_error` is `abort`.

on_errorstring

What a record the new index cannot take does to the conversion. Possible values: - `abort`: the conversion fails, and the job's `error` names the record and the reason. - `continue`: the record is skipped and counted in the job's `records_skipped`.

tagsobject

Custom user tags added to an index, at most 20 per index. Keys must be 80 characters or less and alphanumeric, '_', or '-'. Values must be 120 characters or less and consist of printable ASCII characters or spaces. To unset a key, set the value to be an empty string. `null` in responses when the index has no tags.

deletion_protectionstring

Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`.

Default "disabled"

read_capacityoneOf

By default the index will be created with read capacity mode `OnDemand`, for managed and BYOC indexes alike. If you prefer to allocate dedicated read nodes for your workload, you must specify mode `Dedicated` and additional configurations for `node_type` and `scaling`.

json
{
  "name": "example-index",
  "schema": {
    "fields": {
      "body": {
        "full_text_search": {
          "language": "en"
        },
        "type": "string"
      },
      "your_vector": {
        "dimension": 1536,
        "metric": "cosine",
        "type": "dense_vector"
      }
    }
  },
  "error_mode": {
    "on_error": "abort"
  },
  "tags": {
    "tag0": "val0",
    "tag1": "val1"
  },
  "deletion_protection": "disabled",
  "read_capacity": null
}

Response

Returns 202 with an object. Read it in later steps with {{convertAnIndexIntoADocumentIndex.response.data.<field>}}.

conversion_job_idstring

Pass to Describe a conversion job to track the conversion's progress.

index_idstring

The ID of the document index that was created.

json
{
  "conversion_job_id": "670e8400-e29b-41d4-a716-446655440001",
  "index_id": "123e4567-e89b-12d3-a456-426614174000"
}

Need more? See the Pinecone guide for connection setup and behaviour shared by every action.