Skip to main content
This page shows you how to search an index with sparse vectors for documents that most exactly match the words or phrases in a query.
For general-purpose text retrieval (product search, content discovery, document Q&A), we recommend full-text search. Full-text search runs over string fields you’ve declared with full_text_search enabled, using BM25 ranking and Lucene query syntax. The multi-field schema also lets you add dense_vector or sparse_vector ranking later in the same index.Sparse-vector search (this page) is a distinct retrieval mode. Reach for it when you want token-weighted retrieval with sparse vectors, either generated by Pinecone from a sparse_embed field (pinecone-sparse-english-v0 by default) or produced by your own sparse encoder.
Sparse-vector search uses sparse vectors, which have a very large number of dimensions, where only a small proportion of values are non-zero. The dimensions represent words from a dictionary, and the values represent the importance of these words in the document. Words are scored independently and then summed, with the most similar documents scored highest. For a legacy vector index, see Query vectors. For a legacy integrated index, see Search with text.

Search a document index

In a document index, you choose how to score each search with a clause in score_by. Use a sparse_embed clause to search with text, or a sparse_vector clause to search with a sparse vector you generate yourself.

Search with text

To search with text, the string field must declare sparse_embed, which enables integrated embedding. Pinecone converts your query text to a sparse vector with the field’s model. For example, this searches the chunk_text field of an index whose schema declares "chunk_text": {"type": "string", "sparse_embed": {}} and returns the 3 documents that best match “What is AAPL’s outlook, considering both product launches and market conditions?”:
To require specific terms in each result, add a $match_all text-match filter on the same field, for example, "filter": {"chunk_text": {"$match_all": "AAPL Q4"}}. This works because Pinecone stores the field’s text and indexes it for full-text search unless the field sets store_text: false.

Search with a sparse vector

To search a sparse_vector field, pass a sparse_vector clause in score_by with the query’s sparse vector, produced by the same encoder you used at upsert. For example, this searches the sparse_embedding field of the articles-hybrid schema: