Sparse vector search in Elasticsearch
Serverless Stack
When working with sparse vectors in Elasticsearch, you'll use the Elastic Learned Sparse Encoder (ELSER) at index and query time to expand content into semantically related, weighted terms.
This approach preserves explainability while adding semantic understanding, with each document or query expanded into a set of weighted terms.
Sparse vector search with ELSER is ideal for:
- Enhanced keyword search with semantic expansion
 - Use cases requiring explainable results
 - Domain-specific search
 - Large-scale deployments
 
 Tip 
 Using the semantic_text field type provides automatic model management and sensible defaults. Learn more.
Sparse vector search with ELSER expands both documents and queries into weighted terms. To use sparse vectors in Elasticsearch:
- Index documents with ELSER 
- Deploy and configure the ELSER model
 - Use the 
sparse_vectorfield type - See this overview for implementation options
 
 - Query the index using the 
sparse_vectorquery.