Indexes
In Pinecone, you store data in an index, typically one per use case. Every index is defined by a schema that declares its fields. What the schema can hold, and which API reads and writes the index, is set when you create it. There are two kinds: new indexes are document indexes by default, and vector indexes remain fully supported.Document index
You define aschema with pc.indexes.create (or POST /indexes).
- One schema can combine
dense_vector,sparse_vector, andfull_text_search-enabledstringfields. - A single index can serve full-text search (BM25 with Lucene queries), semantic search, and sparse-vector search together, often covering what previously required two indexes.
- Holds documents, read and written through the Documents API. Pick the ranking signal per query with
score_by.
Vector index
Created withpc.create_index(dimension=..., metric=..., vector_type=...). You don’t declare fields yourself; the SDK builds the schema from the dimension, metric, and vector type you provide.
- Holds records, read and written through the Vectors API.
- Serves semantic search and sparse-vector search.
As of API version
2026-07, POST /indexes in the REST API is schema-only. The SDKs still accept dimension, metric, and vector_type and create a vector index. Existing indexes keep working unchanged on the API they were created with. See Adopt the Documents API for what changed and whether it affects your code.Search approaches
How you rank results depends on the fields your index declares.Full-text search
Full-text search is BM25 token matching with Lucene query syntax over text fields in your schema,string fields you’ve declared with full_text_search enabled. No model required: Pinecone handles tokenization, IDF, and length normalization at index time and BM25 scoring at query time.
When you search, you rank results via score_by: text (BM25), query_string (Lucene), dense_vector, or sparse_vector. All scoring methods can be combined with metadata filters, including the text match operators ($match_phrase, $match_all, $match_any) for phrase and token matching. For example:
Semantic search
A dense vector encodes the meaning of text, images, or other data as a fixed-length list of numbers. Items with similar meaning sit close to each other in vector space, and a query returns the records closest to the query vector. This is semantic search (also called nearest neighbor search, similarity search, or vector search). For the underlying concept, see Dense vector. Learn more:Sparse-vector search
A sparse vector represents tokens (or token-like features) and their weights, with the vast majority of dimensions zero. A query returns records that share the most weighted tokens with the query vector, which is called sparse-vector search. Sparse vectors come from a sparse embedding model. Pinecone hostspinecone-sparse-english-v0; you can also bring your own. For the underlying concept and the distinction from full-text search, see Index with sparse vectors.
Learn more:
Limitations
Indexes of sparse vectors have the following limitations:- Max non-zero values per sparse vector: 2048
- Max upserts per second per index of sparse vectors: 10
- Max queries per second per index of sparse vectors: 100
-
Max
top_kvalue per query: 10,000You may get fewer thantop_kresults iftop_kis larger than the number of sparse vectors in your index that match your query. That is, any vectors where the dotproduct score is0will be discarded. - Max query results size: 4 MB
Namespaces
Within an index, records or documents are partitioned into namespaces, and all upserts, queries, and other data read and write operations always target one namespace. This has two main benefits:- Multitenancy: When you need to isolate data between customers, you can use one namespace per customer and target each customer’s writes and queries to their dedicated namespace. See Implement multitenancy for end-to-end guidance.
- Faster queries: When you divide your data into namespaces in a logical way, you speed up queries by ensuring only relevant records or documents are scanned. The same applies to fetching them, listing their IDs, and other data operations.
Namespaces per serverless index vary by plan. On the Standard and Enterprise plans, Pinecone can accommodate million-scale namespaces and beyond for specific use cases. If your application requires more than 100,000 namespaces, contact Support.
Vector embedding
A schema declares the vector fields your index uses: a dense vector field, a sparse vector field, or both. Dense vectors represent the semantics of data such as text, images, and audio; sparse vectors capture keyword information. To turn your source data into vectors, you use an embedding model. You can either use Pinecone’s integrated embedding models to convert your data to vectors automatically, or use an external embedding model and bring your own vectors to Pinecone.Integrated embedding
Integrated-embedding indexes are created withpc.create_index_for_model and read and written through the Records API. Pinecone generates the vectors from your text automatically, both when you upsert and when you search.
- Create an index that is integrated with one of Pinecone’s hosted embedding models.
- Upsert your source text. Pinecone uses the integrated model to convert the text to vectors automatically.
- Search with a query text. Again, Pinecone uses the integrated model to convert the text to a vector automatically.
Bring your own vectors
- Use an embedding model to convert your text to vectors. The model can be hosted by Pinecone or an external provider.
- Create an index that matches the characteristics of the model.
- Upsert your vectors directly.
- Use the same external embedding model to convert a query to a vector.
- Search with your query vector directly.
Data ingestion
There are two ways to ingest data into an index:- Importing from object storage is the most efficient and cost-effective way to load large numbers of records or documents into an index. You store your data in object storage (Parquet for vector indexes, JSON Lines (JSONL) for document indexes), integrate your object storage with Pinecone, and then start an asynchronous, long-running operation that imports and indexes your data.
- Upserting is intended for ongoing writes to an index. Batch upserting can improve throughput performance and is a good option for larger numbers of records or documents (up to 1000 per batch) if you can’t work around import’s current limitations.
Metadata
Every record has an ID and a vector, and every document has an_id and the fields its schema declares. Either can also carry metadata: extra key-value fields you filter on at query time. In a vector index, you pass metadata as an explicit object with each vector. With integrated embedding or in a document index, extra fields you upsert are stored as metadata automatically. Pinecone indexes metadata for filtering, so a query can include a metadata filter to limit the search. Searches without a metadata filter don’t consider metadata and search the entire namespace.
Metadata format
- Metadata fields must be key-value pairs in a flat JSON object. Nested JSON objects are not supported.
- Keys must be strings and must not start with a
$. - Values must be one of the following data types:
- String
- Integer (converted to a 64-bit floating point by Pinecone)
- Floating point
- Boolean (
true,false) - List of strings
- Null metadata values aren’t supported. Instead of setting a key to
null, remove the key from the metadata payload.
Metadata size
Pinecone supports 40 KB of metadata per record or document.full_text_search string fields aren’t metadata and don’t count toward this limit. Each full_text_search string field is limited to 100 KB and 10,000 tokens.
Metadata filter expressions
Pinecone’s filtering language supports the following operators:At the top level, list one or more fields (combined with implicit AND) or combine clauses with the logical operators
$and and $or. Use $not to negate a clause, as shown in the table. A bare comparison operator (like $gt) can’t appear at the top level; nest it under a field.Each
$in or $nin operator accepts a maximum of 10,000 values. Exceeding this limit will cause the request to fail. For more information, see Metadata filter limits."genre" metadata field with a list of strings:
JSON
"genre" takes on both values, and requests with the following filters will match:
JSON
JSON
JSON
JSON