Updates an index configuration.
Omitted fields remain unchanged.
The index name, such as product-catalog.
The settings to change; provide at least one field.
The updated index configuration and status.
Errors.PineconeArgumentError when the name is empty or no configuration field is provided.
Creates an index with searchable fields defined by a schema.
Creation returns before the index is ready unless waitUntilReady is true.
The index name and schema. Set waitUntilReady to wait before writing data.
The index configuration and status.
Errors.PineconeArgumentError when the index name or schema is missing.
Errors.PineconeConflictError when an index with this name already exists.
Errors.PineconeTimeoutError when the readiness timeout expires.
import { Pinecone } from '@pinecone-database/pinecone';
const pc = new Pinecone();
const index = await pc.indexes.create({
name: 'product-catalog',
schema: { fields: { description: { type: 'string', fullTextSearch: {} } } },
waitUntilReady: true,
});
console.log(index.name);
Indexes.createForModel to embed document text with an integrated model.
Creates an index with searchable fields defined by a schema.
Creation returns before the index is ready unless waitUntilReady is true.
The index name and schema. Set waitUntilReady to wait before writing data.
The index configuration and status, or undefined if suppressConflicts ignores an existing index.
Errors.PineconeArgumentError when the index name or schema is missing.
Errors.PineconeConflictError when the name exists and suppressConflicts is false.
Errors.PineconeTimeoutError when the readiness timeout expires.
import { Pinecone } from '@pinecone-database/pinecone';
const pc = new Pinecone();
const index = await pc.indexes.create({
name: 'product-catalog',
schema: { fields: { description: { type: 'string', fullTextSearch: {} } } },
suppressConflicts: true,
});
console.log(index?.name);
Indexes.createForModel to embed document text with an integrated model.
Creates an index that embeds document text with an integrated model.
Creation returns before the index is ready unless waitUntilReady is true.
The index name, cloud, region, and embedding configuration. Use fieldMap to select your text field.
The index configuration and status.
Errors.PineconeArgumentError when required index or embedding settings are missing or the metric is invalid.
Errors.PineconeConflictError when an index with this name already exists.
Errors.PineconeTimeoutError when the readiness timeout expires.
import { Pinecone } from '@pinecone-database/pinecone';
const pc = new Pinecone();
const index = await pc.indexes.createForModel({
name: 'product-catalog',
cloud: 'aws',
region: 'us-east-1',
embed: {
model: 'multilingual-e5-large',
fieldMap: { text: 'description' },
},
waitUntilReady: true,
});
console.log(index.name);
Indexes.create to define vector or full-text search fields yourself.
Creates an index that embeds document text with an integrated model.
Creation returns before the index is ready unless waitUntilReady is true.
The index name, cloud, region, and embedding configuration. Use fieldMap to select your text field.
The index configuration and status, or undefined if suppressConflicts ignores an existing index.
Errors.PineconeArgumentError when required index or embedding settings are missing or the metric is invalid.
Errors.PineconeConflictError when the name exists and suppressConflicts is false.
Errors.PineconeTimeoutError when the readiness timeout expires.
import { Pinecone } from '@pinecone-database/pinecone';
const pc = new Pinecone();
const index = await pc.indexes.createForModel({
name: 'product-catalog',
cloud: 'aws',
region: 'us-east-1',
embed: {
model: 'multilingual-e5-large',
fieldMap: { text: 'description' },
},
suppressConflicts: true,
});
console.log(index?.name);
Indexes.create to define vector or full-text search fields yourself.
Deletes an index and its data.
Disable deletion protection first. The index may still be terminating when this call returns.
The index name, such as product-catalog.
Resolves when the deletion request is accepted.
Errors.PineconeArgumentError when the index name is empty.
Retrieves the configuration, schema, and readiness of an index.
The index name, such as product-catalog.
The index configuration, host, schema, and current status.
Errors.PineconeArgumentError when the index name is empty.
Lists all indexes in the project.
The indexes and their configuration, schema, and readiness status.
Indexes store documents and define the fields available for search. Access index management through Pinecone.indexes; do not construct this class directly. Use Pinecone.index to read, write, and search data within an index.
Example