Skip to main content
Semantic search finds the documents in an index with dense vectors that are most similar in meaning and context to a query. It’s also called nearest neighbor search, similarity search, or vector search. Semantic search uses dense vectors. Each number in a dense vector corresponds to a point in a multidimensional space. Vectors that are closer together in that space are semantically similar. 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 an embed clause to search with text, or a dense_vector clause to search with a dense vector you generate yourself.

Search with text

To search with text, the string field must declare embed, which enables integrated embedding. Pinecone embeds your query text with the field’s model. For example, this searches the chunk_text field of an index whose schema declares "chunk_text": {"type": "string", "embed": {}} and returns the 2 documents most semantically related to “Disease prevention”:

Search with a dense vector

To search a dense_vector field, pass a dense_vector clause in score_by with the query’s dense vector. Generate the query vector with the same embedding model you used at upsert. For example, this searches the embedding field of the articles-hybrid schema, so the query vector must have 1536 dimensions: