Do not target an index by name in production.When you target an index by name for data operations such as upsert and query, the SDK gets the unique DNS host for the index using the describe_index operation. This is convenient for testing but should be avoided in production because describe_index uses a different API than data operations and therefore adds an additional network call and point of failure. Instead, you should get an index host once and cache it for reuse or specify the host directly.
You can delete an index using the Pinecone console. For the index you want to delete, click the three dots to the right of the index name, then click Delete.
Integrated inference lets you upsert and search without extra steps for embedding data and reranking results.To configure an existing serverless index for an embedding model, use the configure_index operation as follows:
You can prevent an index and its data from accidental deleting when creating a new index or after its been created. In both cases, you set the deletion_protection parameter to enabled.
To enable deletion protection when configuring an existing index:
Copy
from pinecone.grpc import PineconeGRPC as Pineconepc = Pinecone(api_key="YOUR_API_KEY")pc.configure_index( name="docs-example", deletion_protection="enabled")
When deletion protection is enabled on an index, requests to delete the index fail and return a 403 - FORBIDDEN status with the following error:
Copy
Deletion protection is enabled for this index. Disable deletion protection before retrying.
Before you can delete an index with deletion protection enabled, you must first disable deletion protection as follows:
Copy
from pinecone.grpc import PineconeGRPC as Pineconepc = Pinecone(api_key="YOUR_API_KEY")pc.configure_index( name="docs-example", deletion_protection="disabled")
You can add tags during index creation using the Pinecone console.
To add or update tags when configuring an existing index:
Copy
from pinecone.grpc import PineconeGRPC as Pineconepc = Pinecone(api_key="YOUR_API_KEY")pc.configure_index( name="docs-example", tags={ example: "tag", environment: "development" })
You can add or update tags when configuring an existing index using the Pinecone console. Find the index to edit and click the ellipsis (..) menu > Add tags.
To remove a tag from an index, configure the index and use the tags parameter to send the tag key with an empty value ("").The following example removes the example: tag tag from docs-example:
Copy
from pinecone.grpc import PineconeGRPC as Pineconepc = Pinecone(api_key="YOUR_API_KEY")pc.configure_index( name="docs-example", tags={"example": ""})
You can remove tags from an index using the Pinecone console. Find the index to edit and click the ellipsis (..) menu > __ tags.