Skip to main content

ElasticsearchPlugin

This plugin allows your product search to be powered by Elasticsearch โ€” a powerful open source search engine. This is a drop-in replacement for the DefaultSearchPlugin which exposes many powerful configuration options enabling your storefront to support a wide range of use-cases such as indexing of custom properties, fine control over search index configuration, and to leverage advanced Elasticsearch features like spacial search.

Version Requirements

ElasticSearch v9.1.0 is supported

The version of ElasticSearch that is deployed, the version of the JS library @elastic/elasticsearch installed in your Vendure project and the version of the JS library @elastic/elasticsearch used in the @vendure/elasticsearch-plugin must all match to avoid any issues. ElasticSearch does not allow @latest in its repository so these versions must be updated regularly.

PackageVersion
ElasticSearchv9.1.0
@elastic/elasticsearchv9.1.0
@vendure/elasticsearch-pluginv3.5.0
Last updatedDec 2, 2025

With ElasticSearch v8+, basic authentication, SSL, and TLS are enabled by default and may result in your client and plugin not being able to connect to ElasticSearch successfully if your client is not configured appropriately. You must also set xpack.license.self_generated.type=basic if you are using the free Community Edition of ElasticSearch.

Review the ElasticSearch docker example here for development and testing without authentication and security enabled. Refer to ElasticSearch documentation to enable authentication and security in production.

Installation

Make sure to remove the DefaultSearchPlugin if it is still in the VendureConfig plugins array.

Setup

Then add the ElasticsearchPlugin, calling the .init() method with ElasticsearchOptions:

Ts

Search API Extensions

This plugin extends the default search query of the Shop API, allowing richer querying of your product data.

The SearchResponse type is extended with information about price ranges in the result set:

Graphql

This SearchResponsePriceData type allows you to query data about the range of prices in the result set.

Example Request & Response

Graphql
Json
Signature
  • Implements: OnApplicationBootstrap

init

method(options: ElasticsearchOptions) => Type<ElasticsearchPlugin>
Was this chapter helpful?
Report Issue
Edited Apr 3, 2026ยทEdit this page