Type to search.

Sparse vector search in Elasticsearch

Serverless

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

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:

  1. Index documents with ELSER
    • Deploy and configure the ELSER model
    • Use the sparse_vector field type
    • See this overview for implementation options
  2. Query the index using the sparse_vector query.