Back to plugins & integrations

Elasticsearch icon

Elasticsearch

Use Elasticsearch to power your product search

npm install @vendure/elasticsearch-plugin

Integration type

Core
Core open-source plugins built by the Vendure team

Category

Search

Last published

3 days ago

Downloads in past month

3,515
README.md

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.

Installation

Requires Elasticsearch v7.0 - 7.10. Elasticsearch version 7.10.2 will throw error due to incompatibility with elasticsearch-js client. Check here for more info.

npm install @elastic/elasticsearch @vendure/elasticsearch-plugin

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

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

import { ElasticsearchPlugin } from '@vendure/elasticsearch-plugin';

const config: VendureConfig = {
  // Add an instance of the plugin to the plugins array
  plugins: [
    ElasticsearchPlugin.init({
      host: 'http://localhost',
      port: 9200,
    }),
  ],
};

Complete documentation

See the ElasticsearchPlugin docs for complete documentation.