Skip to main content
New projects should use the Documents API. To move an existing index, see Move to the Documents API.
This page shows you how to upsert source text into a legacy integrated index created with create_index_for_model. The legacy Records API converts the text to vectors with the hosted embedding model associated with the index. For a document index with integrated embedding, see Upsert data. When you describe a legacy integrated index, its text field has the semantic_text type. Document schemas don’t use that type.

Upsert text as dense vectors

To upsert source text into a legacy integrated index, use the Upsert text operation. Pinecone converts the text to dense vectors automatically using the hosted dense embedding model associated with the index.
  • Specify the namespace to upsert into. If the namespace doesn’t exist, it’s created. To use the default namespace, set the namespace to "__default__".
  • Format your input data as records, each with the following:
    • An _id field with a unique record identifier for the index namespace. id can be used as an alias for _id.
    • A field with the source text to convert to a vector. This field must match the field_map specified in the index.
    • Additional fields are stored as record metadata and can be returned in search results or used to filter search results.
For example, the following code converts the sentences in the chunk_text fields to dense vectors and then upserts them into example-namespace in an example index. The additional category field is stored as metadata.

Upsert text as sparse vectors

To upsert source text into a legacy integrated index, use the Upsert text operation. Pinecone converts the text to sparse vectors automatically using the hosted sparse embedding model associated with the index.
  • Specify the namespace to upsert into. If the namespace doesn’t exist, it’s created. To use the default namespace, set the namespace to "__default__".
  • Format your input data as records, each with the following:
    • An _id field with a unique record identifier for the index namespace. id can be used as an alias for _id.
    • A field with the source text to convert to a vector. This field must match the field_map specified in the index.
    • Additional fields are stored as record metadata and can be returned in search results or used to filter search results.
For example, the following code converts the sentences in the chunk_text fields to sparse vectors and then upserts them into example-namespace in an example index. The additional category and quarter fields are stored as metadata.