from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
index = pc.Index(host="INDEX_HOST")
index.create_namespace(namespace="example-namespace")
Create a namespace
Create a namespace in a serverless index.
For guidance and examples, see Manage namespaces.
Note: This operation is not supported for pod-based indexes.
from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
index = pc.Index(host="INDEX_HOST")
index.create_namespace(namespace="example-namespace")
from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
index = pc.Index(host="INDEX_HOST")
index.create_namespace(namespace="example-namespace")
Authorizations
Headers
Required date-based version header
Body
A request for creating a namespace with the specified namespace name.
The name of the namespace.
"example-namespace"
Schema for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when schema is present, only fields which are present in the fields object with a filterable: true are indexed. Note that filterable: false is not currently supported.
Show child attributes
Show child attributes
{
"fields": {
"description": { "filterable": true },
"genre": { "filterable": true },
"year": { "filterable": true }
}
}Response
A successful response.
A description of a namespace, including the name and record count.
The name of the namespace.
"example-namespace"
The total amount of records within the namespace.
20000
Schema for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when schema is present, only fields which are present in the fields object with a filterable: true are indexed. Note that filterable: false is not currently supported.
Show child attributes
Show child attributes
{
"fields": {
"description": { "filterable": true },
"genre": { "filterable": true },
"year": { "filterable": true }
}
}A list of all indexed metatadata fields in the namespace
Show child attributes
Show child attributes
Was this page helpful?