1. Managing indexes
Welcome back!
2. Connecting to the index
After creating the Pinecone Python client and creating a serverless index with our desired specifications, we need to actually connect to the index to begin ingesting vectors and querying them.
We can do this with the client's .Index() method, passing it the index to connect to. We assign the resulting object to index, which has its own Python methods for manipulating the vectors it contains.
3. Connecting to the index
Note that if we try to connect to an index that hasn't been created, we get a 404 error message that the index wasn't found.
4. Index statistics
One of the most common Pinecone index methods is .describe_index_stats(), which returns information about the number of vectors in the index, the proportion of the index that is full - the fullness - and the dimensionality of the index, which should correspond to what was set when the index was created.
There's also an empty dictionary to hold namespaces. Let's talk about those.
5. Namespaces
Namespaces are essentially containers for partitioning indexes into smaller units. This could be to keep distinct datasets or data versions separate, or perhaps to partition group in the parent dataset. Queries and other manipulations are then limited to that namespace.
For now, we'll focus on working within a single namespace, but later in the course, we'll discuss distributing vectors and querying across multiple namespaces.
6. Organizations
Organizations also play a key role in managing indexes. They provide control over access and billing to different Pinecone projects.
Pinecone projects can contain many indexes, so the Pinecone ecosystem consists of a hierarchy of organizations at the top, down to projects, indexes, namespaces, and individual records.
7. Organizations
There are two types of organization roles: organization owner and organization user. Organization owners have permissions across the entire organization. This includes managing billing, users, and all projects.
Organization users have restricted organization-level permissions. Organization owners invite them to the organization and assign them to specific projects, of which, they become project owners.
8. Deleting indexes
Finally, if our data is no longer of use, or the index no longer suits our use case, we may want to delete it.
We can do this with the .delete_index() method.
When we do this, we'll see the index disappear in the .list_indexes() output.
It's important to note that deleting an index also deletes all of the records it contains, so delete with caution!
9. Let's practice!
Time to try these new methods out!